summaryrefslogtreecommitdiffstats
path: root/utils
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 /utils
parent5049635bc3b6c1e261c57774e79345876644dfa2 (diff)
downloadlibpinyin-a6879516feb3e906ba1d0ed7847300bcfee7e092.zip
libpinyin-a6879516feb3e906ba1d0ed7847300bcfee7e092.tar.gz
libpinyin-a6879516feb3e906ba1d0ed7847300bcfee7e092.tar.xz
fixes memory leaks
Diffstat (limited to 'utils')
-rw-r--r--utils/storage/export_interpolation.cpp1
-rw-r--r--utils/utils_helper.h1
2 files changed, 2 insertions, 0 deletions
diff --git a/utils/storage/export_interpolation.cpp b/utils/storage/export_interpolation.cpp
index 99c76aa..c43eefb 100644
--- a/utils/storage/export_interpolation.cpp
+++ b/utils/storage/export_interpolation.cpp
@@ -136,6 +136,7 @@ bool gen_bigram(FILE * output, FacadePhraseIndex * phrase_index, Bigram * bigram
}
g_array_free(array, TRUE);
+ delete single_gram;
}
g_array_free(items, TRUE);
diff --git a/utils/utils_helper.h b/utils/utils_helper.h
index 86d5849..b91067b 100644
--- a/utils/utils_helper.h
+++ b/utils/utils_helper.h
@@ -85,6 +85,7 @@ static bool load_phrase_index(const pinyin_table_info_t * phrase_files,
bool retval = chunk->load(binfile);
if (!retval) {
fprintf(stderr, "load %s failed!\n", binfile);
+ delete chunk;
return false;
}