[Beignet] [PATCH 1/2] reset the variables in printf_paser to NULL.

xionghu.luo at intel.com xionghu.luo at intel.com
Wed Oct 14 02:35:23 PDT 2015


From: Luo Xionghu <xionghu.luo at intel.com>

the printfPaser variables g1Xg2Xg3 and wg_offset should be reinit
after the builder is deleted, or else the variables will be freed and
caused memory leak;

Signed-off-by: Luo Xionghu <xionghu.luo at intel.com>
---
 backend/src/llvm/llvm_printf_parser.cpp | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/backend/src/llvm/llvm_printf_parser.cpp b/backend/src/llvm/llvm_printf_parser.cpp
index 1e8427c..bdaed8a 100644
--- a/backend/src/llvm/llvm_printf_parser.cpp
+++ b/backend/src/llvm/llvm_printf_parser.cpp
@@ -723,6 +723,8 @@ error:
 
     deadprintfs.clear();
     delete builder;
+    g1Xg2Xg3 = NULL;
+    wg_offset = NULL;
 
     return changed;
   }
-- 
1.9.1



More information about the Beignet mailing list