summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Ellur <vivek.ellur@samsung.com>2015-11-10 12:26:40 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-11-10 12:26:40 -0500
commit54a613eda97da6060c73212f107d6fa9f32eebd1 (patch)
tree16a5afae7c682197986e75eab6132df46709cd6f
parentf026fdf9b345837d1145f657b2c8ef04765acc60 (diff)
Fix memory leak issue
Summary: @Fix Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com> Reviewers: zmike Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D3307
-rw-r--r--src/modules/wl_weekeyboard/e_mod_main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/modules/wl_weekeyboard/e_mod_main.c b/src/modules/wl_weekeyboard/e_mod_main.c
index bb5cbe714..c90f0fd86 100644
--- a/src/modules/wl_weekeyboard/e_mod_main.c
+++ b/src/modules/wl_weekeyboard/e_mod_main.c
@@ -41,8 +41,17 @@ _wkb_insert_text(const char *text, uint32_t offset, const char *insert)
41 char *new_text = malloc(strlen(text) + strlen(insert) + 1); 41 char *new_text = malloc(strlen(text) + strlen(insert) + 1);
42 uint32_t text_len = 0; 42 uint32_t text_len = 0;
43 43
44 if (!new_text)
45 {
46 ERR("out of memory");
47 return NULL;
48 }
49
44 if ((!text) || (!insert)) 50 if ((!text) || (!insert))
45 return NULL; 51 {
52 free(new_text);
53 return NULL;
54 }
46 55
47 text_len = strlen(text); 56 text_len = strlen(text);
48 if (offset > text_len) 57 if (offset > text_len)