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:
Chris Michael 2013-08-05 15:32:12 +01:00
parent d384574095
commit ff9b4775e8
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}
}