From 75a9c152b835c7e66222e23eba041bb6e09e6dac Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Mon, 5 Dec 2011 15:47:48 +0800 Subject: clean up parse_one_key in full pinyin parser2 --- src/storage/pinyin_parser2.cpp | 6 ++++-- 1 file 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. */ -- cgit