edc_editor, edc_parser: fixed resource leak.

This fixes coverity CID 47576, 47577, and 47578.
This commit is contained in:
Daniel Juyung Seo 2014-08-23 01:01:37 +09:00 committed by ChunEon Park
parent 7571783f4a
commit c687b539a7
2 changed files with 25 additions and 5 deletions

View File

@ -644,7 +644,11 @@ image_preview_show(edit_data *ed, char *cur, Evas_Coord x, Evas_Coord y)
ctxpopup_img_preview_create(ed, fullpath,
ctxpopup_preview_dismiss_cb,
ctxpopup_preview_relay_cb);
if (!ctxpopup) return EINA_FALSE;
if (!ctxpopup)
{
free(filename);
return EINA_FALSE;
}
evas_object_move(ctxpopup, x, y);
evas_object_show(ctxpopup);

View File

@ -728,10 +728,18 @@ parser_cur_group_name_get(parser_data *pd, Evas_Object *entry,
if (!td) return;
const char *text = elm_entry_entry_get(entry);
if (!text) return;
if (!text)
{
free(td);
return;
}
char *utf8 = elm_entry_markup_to_utf8(text);
if (!utf8) return;
if (!utf8)
{
free(td);
return;
}
td->pd = pd;
td->utf8 = utf8;
@ -756,10 +764,18 @@ parser_cur_name_get(parser_data *pd, Evas_Object *entry, void (*cb)(void *data,
if (!td) return;
const char *text = elm_entry_entry_get(entry);
if (!text) return;
if (!text)
{
free(td);
return;
}
char *utf8 = elm_entry_markup_to_utf8(text);
if (!utf8) return;
if (!utf8)
{
free(td);
return;
}
td->pd = pd;
td->utf8 = utf8;