Commit 673702af1ddf0123458210f6260b8664e1aaff60

Stefan Sperling 2018-07-23T10:37:54

fix leak in dump_delta_chain_to_file()

1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/lib/pack.c b/lib/pack.c
index 4ad316f..9aa5fdb 100644
--- a/lib/pack.c
+++ b/lib/pack.c
@@ -1391,7 +1391,7 @@ done:
 		size_t len = fwrite(accum_buf, 1, accum_size, outfile);
 		free(accum_buf);
 		if (len != accum_size)
-			return got_ferror(outfile, GOT_ERR_IO);
+			err = got_ferror(outfile, GOT_ERR_IO);
 	}
 	if (base_file)
 		fclose(base_file);