edje_edit: Check return value of eet_list() to avoid NULL dereference.

We check eet_list elsewhere and it might retrun NULL. Don't just hope
keys will never be NULL. Check it.

CID 1232733
This commit is contained in:
Stefan Schmidt 2014-09-04 14:18:58 +02:00
parent 0d9f0d8ffb
commit 703d179eb6
1 changed files with 11 additions and 8 deletions

View File

@ -210,6 +210,8 @@ _edje_edit_efl_file_file_set(Eo *obj, Edje_Edit *eed, const char *file, const ch
snprintf(buf, sizeof(buf), "edje/scripts/embryo/source/%i/*",
eed->base->collection->id);
keys = eet_list(ef, buf, &count);
if (keys)
{
for (i = 0; i < count; i++)
{
Program_Script *ps;
@ -221,7 +223,8 @@ _edje_edit_efl_file_file_set(Eo *obj, Edje_Edit *eed, const char *file, const ch
ps->code = eet_read(ef, keys[i], &size);
eina_hash_add(eed->program_scripts, &ps->id, ps);
}
if (keys) free(keys);
free(keys);
}
eet_close(ef);
ret = EINA_TRUE;