summaryrefslogtreecommitdiffstats
path: root/utils/utils_helper.h
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2013-06-17 15:46:24 +0800
committerPeng Wu <alexepico@gmail.com>2013-06-17 15:46:24 +0800
commit5049635bc3b6c1e261c57774e79345876644dfa2 (patch)
tree1f25cfff2b8489b5072eb924124d917d174a236e /utils/utils_helper.h
parent77d9412336783469b7cebd37188f644e51f1a5df (diff)
downloadlibpinyin-5049635bc3b6c1e261c57774e79345876644dfa2.tar.gz
libpinyin-5049635bc3b6c1e261c57774e79345876644dfa2.tar.xz
libpinyin-5049635bc3b6c1e261c57774e79345876644dfa2.zip
fixes memory leaks
Diffstat (limited to 'utils/utils_helper.h')
-rw-r--r--utils/utils_helper.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/utils/utils_helper.h b/utils/utils_helper.h
index be4f05f..86d5849 100644
--- a/utils/utils_helper.h
+++ b/utils/utils_helper.h
@@ -109,6 +109,7 @@ static bool save_phrase_index(const pinyin_table_info_t * phrase_files,
bool retval = new_chunk->save(binfile);
if (!retval) {
fprintf(stderr, "save %s failed.", binfile);
+ delete new_chunk;
return false;
}
@@ -133,6 +134,7 @@ static bool save_dictionary(const pinyin_table_info_t * phrase_files,
bool retval = new_chunk->save(binfile);
if (!retval) {
fprintf(stderr, "save %s failed.", binfile);
+ delete new_chunk;
return false;
}