Browse Source

Ensure propertly cleanup when image writting is canceled.

release-1.5.4.branch
Vreixo Formoso 15 years ago
parent
commit
99bcef4c53
  1. 5
      libisofs/filesrc.c

5
libisofs/filesrc.c

@ -295,10 +295,13 @@ int filesrc_writer_write_data(IsoImageWriter *writer)
wres = iso_write(t, buffer, BLOCK_SIZE);
if (wres < 0) {
/* ko, writer error, we need to go out! */
filesrc_close(file);
return wres;
}
}
filesrc_close(file);
if (b < nblocks) {
/* premature end of file, due to error or eof */
char *name = iso_stream_get_name(file->stream);
@ -329,8 +332,6 @@ int filesrc_writer_write_data(IsoImageWriter *writer)
}
}
}
filesrc_close(file);
}
return ISO_SUCCESS;

Loading…
Cancel
Save