projects
/
platform
/
upstream
/
libpinyin.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6c5a8a7
)
fixes memory leak in test chewing table
author
Peng Wu
<alexepico@gmail.com>
Wed, 10 Oct 2012 10:07:21 +0000
(18:07 +0800)
committer
Peng Wu
<alexepico@gmail.com>
Wed, 10 Oct 2012 10:07:21 +0000
(18:07 +0800)
tests/storage/test_chewing_table.cpp
patch
|
blob
|
history
diff --git
a/tests/storage/test_chewing_table.cpp
b/tests/storage/test_chewing_table.cpp
index
cae766d
..
369f726
100644
(file)
--- 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);
}