Closed memory leak with error while creating IsoFile object. Coverity CID 12574.

This commit is contained in:
Thomas Schmitt 2015-10-09 20:42:08 +02:00
parent 78d2c02ad8
commit a6542e5fa9

View File

@ -76,9 +76,12 @@ int default_create_file(IsoNodeBuilder *builder, IsoImage *image,
if ((int) strlen(name) > image->truncate_length) { if ((int) strlen(name) > image->truncate_length) {
ret = iso_truncate_rr_name(image->truncate_mode, ret = iso_truncate_rr_name(image->truncate_mode,
image->truncate_length, name, 0); image->truncate_length, name, 0);
if (ret < 0) if (ret < 0) {
iso_stream_unref(stream);
free(name);
return ret; return ret;
} }
}
ret = iso_node_new_file(name, stream, &node); ret = iso_node_new_file(name, stream, &node);
if (ret < 0) { if (ret < 0) {
iso_stream_unref(stream); iso_stream_unref(stream);