diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:33:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-13 12:33:02 +0000 |
commit | 4fa488fb0159c629483b7994aa84e73926b132b9 (patch) | |
tree | 182a19db69cdcb92be54cc6a5b0b9bfab28f80fd /wsrep-lib/include/wsrep/logger.hpp | |
parent | Adding debian version 1:10.11.6-2. (diff) | |
download | mariadb-4fa488fb0159c629483b7994aa84e73926b132b9.tar.xz mariadb-4fa488fb0159c629483b7994aa84e73926b132b9.zip |
Merging upstream version 1:10.11.7.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'wsrep-lib/include/wsrep/logger.hpp')
-rw-r--r-- | wsrep-lib/include/wsrep/logger.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/wsrep-lib/include/wsrep/logger.hpp b/wsrep-lib/include/wsrep/logger.hpp index a15873c2..4a9c46b1 100644 --- a/wsrep-lib/include/wsrep/logger.hpp +++ b/wsrep-lib/include/wsrep/logger.hpp @@ -86,7 +86,11 @@ namespace wsrep { if (logger_fn_) { - logger_fn_(level_, prefix_, oss_.str().c_str()); + // Prolong the lifetime of the string so it doesn't get + // destroyed right after evaluating c_str() and before + // completing the logger function call. + const std::string& tmp = oss_.str(); + logger_fn_(level_, prefix_, tmp.c_str()); } else { |