Commit Diff


commit - 4dd6eb4bad0365bcd6afea1defced7034794323e
commit + 8dfb8335f908abe468c096ff44dc3b400078dd24
blob - 637ec2cd3baf5cc77c6593f1630808a6e0b7b58e
blob + 954b33f5b857db2f38e74101331f458b1fd84c74
--- lib/pack_create.c
+++ lib/pack_create.c
@@ -114,8 +114,11 @@ free_nmeta(struct got_pack_meta **meta, int nmeta)
 {
 	int i;
 
-	for (i = 0; i < nmeta; i++)
+	for (i = 0; i < nmeta; i++) {
 		clear_meta(meta[i]);
+		got_deltify_free(meta[i]->dtab);
+	}
+
 	free(meta);
 }
 
@@ -691,10 +694,6 @@ pick_deltas(struct got_pack_meta **meta, int nmeta, in
 		raw = NULL;
 	}
 done:
-	for (i = MAX(0, nmeta - max_base_candidates); i < nmeta; i++) {
-		got_deltify_free(meta[i]->dtab);
-		meta[i]->dtab = NULL;
-	}
 	if (raw)
 		got_object_raw_close(raw);
 	if (base_raw)