diff options
author | Peng Wu <alexepico@gmail.com> | 2012-10-10 18:07:21 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2012-10-10 18:07:21 +0800 |
commit | 995a9df0af809ee2b21b60b32ae424cf57f378e2 (patch) | |
tree | 96cdbfbf4cc57528e1288137ca2821f7670bd098 /tests/storage | |
parent | 6c5a8a7b733263afc60c1bfd885802907e37070d (diff) | |
download | libpinyin-995a9df0af809ee2b21b60b32ae424cf57f378e2.tar.gz libpinyin-995a9df0af809ee2b21b60b32ae424cf57f378e2.tar.xz libpinyin-995a9df0af809ee2b21b60b32ae424cf57f378e2.zip |
fixes memory leak in test chewing table
Diffstat (limited to 'tests/storage')
-rw-r--r-- | tests/storage/test_chewing_table.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/storage/test_chewing_table.cpp b/tests/storage/test_chewing_table.cpp index cae766d..369f726 100644 --- a/tests/storage/test_chewing_table.cpp +++ b/tests/storage/test_chewing_table.cpp @@ -109,8 +109,10 @@ int main(int argc, char * argv[]) { item.get_nth_pronunciation(m, chewing_buffer, freq); for (size_t n = 0; n < item.get_phrase_length(); ++n){ - printf("%s'", - chewing_buffer[n].get_pinyin_string()); + gchar * pinyins = + chewing_buffer[n].get_pinyin_string(); + printf("%s'", pinyins); + g_free(pinyins); } printf("\b\t%d\t", freq); } |