summaryrefslogtreecommitdiff
path: root/src/modules/wl_weekeyboard/e_mod_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/wl_weekeyboard/e_mod_main.c')
-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)