Closed memory leaks with errors in ecma119_image_new(). Coverity CID 12582.

This commit is contained in:
Thomas Schmitt 2015-10-10 15:21:27 +02:00
parent 28b41bce2c
commit d5f1eb9c65
1 changed files with 8 additions and 4 deletions

View File

@ -2398,10 +2398,14 @@ int ecma119_image_new(IsoImage *src, IsoWriteOpts *in_opts, Ecma119Image **img)
sa_type = (system_area_options >> 2) & 0x3f; sa_type = (system_area_options >> 2) & 0x3f;
if (sa_type != 0 && sa_type != 3) if (sa_type != 0 && sa_type != 3)
for (i = 0; i < ISO_MAX_PARTITIONS; i++) for (i = 0; i < ISO_MAX_PARTITIONS; i++)
if (opts->appended_partitions[i] != NULL) if (opts->appended_partitions[i] != NULL) {
return ISO_NON_MBR_SYS_AREA; ret = ISO_NON_MBR_SYS_AREA;
if (sa_type != 0 && opts->prep_partition != NULL) goto target_cleanup;
return ISO_NON_MBR_SYS_AREA; }
if (sa_type != 0 && opts->prep_partition != NULL) {
ret = ISO_NON_MBR_SYS_AREA;
goto target_cleanup;
}
target->system_area_data = NULL; target->system_area_data = NULL;
if (system_area != NULL) { if (system_area != NULL) {