threads / patch / 16026

patchindex-pack: don't leak leaf delta result

Subject: [PATCH] index-pack: don't leak leaf delta result

## tl;dr

One message between Oct 23, 2008 and Oct 23, 2008. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Nicolas Pitre· Oct 23, 2008, 19:05 UTC · lore
Another (but minor this time) fallout from commit 9441b61dc5.
Signed-off-by: Nicolas Pitre <nico@cam.org>
Show changes to index-pack.c +3 −1
diff --git a/index-pack.c b/index-pack.c
index 7f97faa..fe75332 100644
--- a/index-pack.c
+++ b/index-pack.c
@@ -550,8 +550,10 @@ static void find_unresolved_deltas(struct base_data *base,
 		find_delta_children(&base_spec, &ofs_first, &ofs_last);
 	}
 
-	if (ref_last == -1 && ofs_last == -1)
+	if (ref_last == -1 && ofs_last == -1) {
+		free(base->data);
 		return;
+	}
 
 	link_base_data(prev_base, base);
 


Nicolas

← back to recent threads