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

1 messages from 2008-10-23 to 2008-10-23. Participants: Nicolas Pitre.
Thread: https://gitlist.dev/t/16026

## Nicolas Pitre, 2008-10-23 19:05

Subject: [PATCH] index-pack: don't leak leaf delta result
Message-ID: <alpine.LFD.2.00.0810231502250.26244@xanadu.home>
URL: https://gitlist.dev/e/alpine.LFD.2.00.0810231502250.26244%40xanadu.home

```
Another (but minor this time) fallout from commit 9441b61dc5.

Signed-off-by: Nicolas Pitre <nico@cam.org>

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

```
