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:
Vivek Ellur 2015-11-10 12:26:40 -05:00 committed by Mike Blumenkrantz
parent 523400269b
commit 89c9b15a75
1 changed files with 10 additions and 1 deletions

View File

@ -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);
uint32_t text_len = 0;
if (!new_text)
{
ERR("out of memory");
return NULL;
}
if ((!text) || (!insert))
return NULL;
{
free(new_text);
return NULL;
}
text_len = strlen(text);
if (offset > text_len)