summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2016-04-12 10:42:52 +0800
committerPeng Wu <alexepico@gmail.com>2016-04-12 10:45:51 +0800
commitf9433cf1b2ed101d67bab38aad24bdca86247b5b (patch)
tree3e0c0c8420e5693772ea04da3cada2aef23a4fba
parent49eb4865f2c01326fddd0818205fc8ac4cb1033b (diff)
downloadibus-libzhuyin-f9433cf1b2ed101d67bab38aad24bdca86247b5b.tar.gz
ibus-libzhuyin-f9433cf1b2ed101d67bab38aad24bdca86247b5b.tar.xz
ibus-libzhuyin-f9433cf1b2ed101d67bab38aad24bdca86247b5b.zip
fixes leak
-rw-r--r--src/ZYLibZhuyin.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ZYLibZhuyin.cc b/src/ZYLibZhuyin.cc
index 9708bbb..f6bc01a 100644
--- a/src/ZYLibZhuyin.cc
+++ b/src/ZYLibZhuyin.cc
@@ -160,8 +160,10 @@ LibZhuyinBackEnd::importZhuyinDictionary (const char * filename)
import_iterator_t * iter = zhuyin_begin_add_phrases
(m_zhuyin_context, USER_DICTIONARY);
- if (NULL == iter)
+ if (NULL == iter) {
+ fclose(dictfile);
return FALSE;
+ }
char* linebuf = NULL; size_t size = 0; ssize_t read;
while ((read = getline (&linebuf, &size, dictfile)) != -1) {