From a6879516feb3e906ba1d0ed7847300bcfee7e092 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 17 Jun 2013 16:01:46 +0800 Subject: fixes memory leaks --- utils/storage/export_interpolation.cpp | 1 + utils/utils_helper.h | 1 + 2 files changed, 2 insertions(+) (limited to 'utils') 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; } -- cgit