Closed a potential memory leak in case of memory shortage
This commit is contained in:
parent
4d10b8c73c
commit
6fd859a2c1
@ -112,7 +112,12 @@ int iso_file_src_create(Ecma119Image *img, IsoFile *file, IsoFileSrc **src)
|
||||
} else {
|
||||
fsrc->nsections = 1;
|
||||
}
|
||||
fsrc->sections = calloc(fsrc->nsections, sizeof(struct iso_file_section));
|
||||
fsrc->sections = calloc(fsrc->nsections,
|
||||
sizeof(struct iso_file_section));
|
||||
if (fsrc->sections == NULL) {
|
||||
free(fsrc);
|
||||
return ISO_OUT_OF_MEM;
|
||||
}
|
||||
}
|
||||
fsrc->sort_weight = file->sort_weight;
|
||||
fsrc->stream = file->stream;
|
||||
|
Loading…
Reference in New Issue
Block a user