forked from enlightenment/efl
Fix memleak in data_thread_script of edje_cc_out
NB: If we are going to exit data_thread_script function due to malloc failure or fread failure, then we should close the previously fdopen'd file so that we do not leak 'f'. Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
d384574095
commit
ff9b4775e8
|
@ -1185,6 +1185,7 @@ data_thread_script(void *data, Ecore_Thread *thread EINA_UNUSED)
|
|||
sc->tmpo);
|
||||
sc->errstr = strdup(buf);
|
||||
free(dat);
|
||||
fclose(f);
|
||||
return;
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "edje/scripts/embryo/compiled/%i",
|
||||
|
@ -1197,6 +1198,7 @@ data_thread_script(void *data, Ecore_Thread *thread EINA_UNUSED)
|
|||
snprintf(buf, sizeof(buf),
|
||||
"Alloc failed for %lu bytes", (unsigned long)size);
|
||||
sc->errstr = strdup(buf);
|
||||
fclose(f);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue