Commit Diff


commit - 6be067cef84c15f7e8623ec8fccaf955d98d006b
commit + 565f18a82d800171c586b1877798c6e794b56505
blob - 19b8418d8d3b6252476d3f2048056a0c997b1377
blob + 6994c4024682259cc76c3a24d97361051a9b8ee5
--- lib/fileindex.c
+++ lib/fileindex.c
@@ -752,8 +752,10 @@ got_fileindex_read(struct got_fileindex *fileindex, FI
 		if (err)
 			return err;
 		err = add_entry(fileindex, ie);
-		if (err)
+		if (err) {
+			got_fileindex_entry_free(ie);
 			return err;
+		}
 	}
 
 	n = fread(sha1_expected, 1, sizeof(sha1_expected), infile);