diff options
Diffstat (limited to 'src/storage')
-rw-r--r-- | src/storage/pinyin_parser2.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/storage/pinyin_parser2.cpp b/src/storage/pinyin_parser2.cpp index 7e98b4d..727dc28 100644 --- a/src/storage/pinyin_parser2.cpp +++ b/src/storage/pinyin_parser2.cpp @@ -217,8 +217,10 @@ bool FullPinyinParser2::parse_one_key (pinyin_option_t options, ChewingKey & key /* Note: optimize here? */ input[parsed_len] = '\0'; - if (!search_pinyin_index(options, input, key, key_rest)) - --parsed_len; + if (!search_pinyin_index(options, input, key, key_rest)) { + g_free(input); + return false; + } if (options & USE_TONE) { /* post processing tone. */ |