forked from enlightenment/enlightenment
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
This commit is contained in:
parent
f026fdf9b3
commit
54a613eda9
|
@ -41,8 +41,17 @@ _wkb_insert_text(const char *text, uint32_t offset, const char *insert)
|
||||||
char *new_text = malloc(strlen(text) + strlen(insert) + 1);
|
char *new_text = malloc(strlen(text) + strlen(insert) + 1);
|
||||||
uint32_t text_len = 0;
|
uint32_t text_len = 0;
|
||||||
|
|
||||||
|
if (!new_text)
|
||||||
|
{
|
||||||
|
ERR("out of memory");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if ((!text) || (!insert))
|
if ((!text) || (!insert))
|
||||||
return NULL;
|
{
|
||||||
|
free(new_text);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
text_len = strlen(text);
|
text_len = strlen(text);
|
||||||
if (offset > text_len)
|
if (offset > text_len)
|
||||||
|
|
Loading…
Reference in New Issue