summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2013-06-17 16:01:46 +0800
committerPeng Wu <alexepico@gmail.com>2013-06-17 16:01:46 +0800
commita6879516feb3e906ba1d0ed7847300bcfee7e092 (patch)
tree765c799b8996c190925c93d17c1ef73556cab9f2 /src
parent5049635bc3b6c1e261c57774e79345876644dfa2 (diff)
downloadlibpinyin-a6879516feb3e906ba1d0ed7847300bcfee7e092.tar.gz
libpinyin-a6879516feb3e906ba1d0ed7847300bcfee7e092.tar.xz
libpinyin-a6879516feb3e906ba1d0ed7847300bcfee7e092.zip
fixes memory leaks
Diffstat (limited to 'src')
-rw-r--r--src/storage/phrase_index.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/storage/phrase_index.cpp b/src/storage/phrase_index.cpp
index 930d606..5fe61c2 100644
--- a/src/storage/phrase_index.cpp
+++ b/src/storage/phrase_index.cpp
@@ -458,8 +458,12 @@ bool SubPhraseIndex::merge(PhraseIndexLogger * logger){
olditem.m_chunk.set_chunk(oldchunk.begin(), oldchunk.size(),
NULL);
- if (olditem != *tmpitem)
+
+ if (olditem != *tmpitem) {
+ delete tmpitem;
return false;
+ }
+
delete tmpitem;
break;