Closed memory leak with assert error or memory shortage while creating

SL entry. Coverity CID 12576.
This commit is contained in:
Thomas Schmitt 2015-10-10 11:48:52 +02:00
parent d04abdcfbd
commit fbe7f1e89d

View File

@ -577,12 +577,15 @@ int rrip_add_SL(Ecma119Image *t, struct susp_info *susp, uint8_t **comp,
* debug purposes * debug purposes
*/ */
if (ce == 0) { if (ce == 0) {
free(SL);
return ISO_ASSERT_FAILURE; return ISO_ASSERT_FAILURE;
} }
ret = susp_append_ce(t, susp, SL); ret = susp_append_ce(t, susp, SL);
if (ret < 0) { if (ret < 0) {
free(SL);
return ret; return ret;
} }
SL = NULL; /* now owned by susp */
written = i; written = i;
total_comp_len = comp[i][1] + 2; total_comp_len = comp[i][1] + 2;
} }