diff options
author | SangHyeon Jade Lee <sh10233.lee@samsung.com> | 2019-09-20 10:40:01 +0900 |
---|---|---|
committer | SangHyeon Jade Lee <sh10233.lee@samsung.com> | 2019-09-23 16:27:07 +0900 |
commit | 3d539c11316ad051cfb0bf575f6f58e757cc39ae (patch) | |
tree | 730a67d1448501512690c1a5f4b89dd4c8b7fd63 | |
parent | 18e9a224beed7407b46c82f6d0bf282aa4376bf0 (diff) | |
download | efl-3d539c11316ad051cfb0bf575f6f58e757cc39ae.tar.gz |
efl_ui : fix possible memory leak on model compressing
Summary: fix memory leak of model compressing on binbuf and allocated data.
Reviewers: cedric, bu5hm4n, zmike
Reviewed By: cedric, zmike
Subscribers: #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D10037
-rw-r--r-- | src/lib/elementary/efl_ui_exact_model.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/lib/elementary/efl_ui_exact_model.c b/src/lib/elementary/efl_ui_exact_model.c index eba69854b9..23b97db7e9 100644 --- a/src/lib/elementary/efl_ui_exact_model.c +++ b/src/lib/elementary/efl_ui_exact_model.c @@ -95,10 +95,19 @@ _efl_ui_exact_model_slot_compress(unsigned int index, Eina_List *compressed, uns unsigned char *zmem; zmem = calloc(EFL_UI_EXACT_MODEL_CONTENT, sizeof (unsigned int)); - if (!zmem) return compressed; + if (!zmem) + { + if (cbuf) eina_binbuf_free(cbuf); + return compressed; + } tbuf = eina_binbuf_manage_new(zmem, EFL_UI_EXACT_MODEL_CONTENT_LENGTH, EINA_TRUE); - if (!tbuf) return compressed; + if (!tbuf) + { + if (cbuf) eina_binbuf_free(cbuf); + if (zmem) free(zmem); + return compressed; + } z = emile_compress(tbuf, EMILE_LZ4, EMILE_COMPRESSOR_FAST); |