summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuo Xionghu <xionghu.luo@intel.com>2015-10-20 03:11:05 -0400
committerYang Rong <rong.r.yang@intel.com>2015-10-20 17:11:17 +0800
commitdcc189bed5b395d6fbcdffa29e60e68cf1071310 (patch)
treecd2a13f5b2ce42e60afe1d61d5c89a416cab7ec8
parent566b153e1124de894cdcbd63aa11782f54bbef02 (diff)
reset the variables in printf_paser to NULL.
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@intel.com> Reviewed-by: Ruiling Song <ruiling.song@intel.com>
-rw-r--r--backend/src/llvm/llvm_printf_parser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/backend/src/llvm/llvm_printf_parser.cpp b/backend/src/llvm/llvm_printf_parser.cpp
index 1e8427c5..bdaed8ab 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;
}