This is an automated email from the ASF dual-hosted git repository.

serverglen pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new dd53fc66 Fix demangle core (#2037)
dd53fc66 is described below

commit dd53fc6637c7864c71ccf1a7fa6cff4996a0d982
Author: Weibing Wang <[email protected]>
AuthorDate: Tue Dec 6 16:25:18 2022 +0800

    Fix demangle core (#2037)
---
 src/butil/class_name.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/butil/class_name.cpp b/src/butil/class_name.cpp
index 133b45b9..0312c4b7 100644
--- a/src/butil/class_name.cpp
+++ b/src/butil/class_name.cpp
@@ -49,7 +49,7 @@ std::string demangle(const char* name) {
     //   -3: One of the arguments is invalid.
     int status = 0;
     char* buf = abi::__cxa_demangle(name, NULL, NULL, &status);
-    if (status == 0) {
+    if (status == 0 && buf) {
         std::string s(buf);
         free(buf);
         return s;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to