Commit ec889268085d81afd9751a21fd0ed9ece3a824a7

Stefan Sperling 2018-03-14T23:32:19

fix open file handle leak in dump_delta_chain()

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/lib/pack.c b/lib/pack.c
index c7bfedc..8d1a801 100644
--- a/lib/pack.c
+++ b/lib/pack.c
@@ -1182,7 +1182,8 @@ dump_delta_chain(struct got_delta_chain *deltas, FILE *outfile,
 			    delta_len, path_packfile, repo);
 			if (err)
 				goto done;
-		}
+		} else
+			fclose(delta_file);
 		/* delta_buf is now cached */
 
 		err = got_delta_apply(base_file, delta_buf, delta_len,