summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/mar/mar-extract-only.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/mdk-stage1/mar/mar-extract-only.c b/mdk-stage1/mar/mar-extract-only.c
index 39f3d0ef5..b69e3101d 100644
--- a/mdk-stage1/mar/mar-extract-only.c
+++ b/mdk-stage1/mar/mar-extract-only.c
@@ -181,6 +181,8 @@ mar_extract_file(char *mar_filename, char *filename_to_extract, char *dest_dir)
int to_read = i > sizeof(garb_buf) ? sizeof(garb_buf) : i;
if (BZ2_bzread(s.mar_zfile, garb_buf, to_read) != to_read) {
log_message("MAR: unexpected EOF in stream");
+ close(fd);
+ unlink(dest_file);
return -1;
}
i -= to_read;