From: Pan Xiuli <[email protected]>

We need to free what we get from abi::__cxa_demangle

Signed-off-by: Pan Xiuli <[email protected]>
---
 backend/src/llvm/llvm_gen_backend.hpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/backend/src/llvm/llvm_gen_backend.hpp 
b/backend/src/llvm/llvm_gen_backend.hpp
index 23688f5..f2a278e 100644
--- a/backend/src/llvm/llvm_gen_backend.hpp
+++ b/backend/src/llvm/llvm_gen_backend.hpp
@@ -83,12 +83,13 @@ namespace gbe
 
       if (it == map.end()) {
         int status;
-        const char *realName = abi::__cxa_demangle(symbol.c_str(), NULL, NULL, 
&status);
+        char *realName = abi::__cxa_demangle(symbol.c_str(), NULL, NULL, 
&status);
         if (status == 0) {
           std::string realFnName(realName), stripName;
           stripName = realFnName.substr(0, realFnName.find("("));
           it = map.find(stripName);
         }
+        free(realName);
       }
       // FIXME, should create a complete error reporting mechanism
       // when found error in beignet managed passes including Gen pass.
-- 
2.5.0

_______________________________________________
Beignet mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to