refs.c: free duplicate entries in the ref array instead of leaking them
authorBrandon Casey <drafnel@gmail.com>
Sat, 8 Oct 2011 03:20:22 +0000 (22:20 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 10 Oct 2011 17:05:39 +0000 (10:05 -0700)
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refs.c
diff --git a/refs.c b/refs.c
index cbc4c5d28d3252a3336cfa370cb3d720d5d8556d..df392976043c9ef025b3c55469810d768eddf794 100644 (file)
--- a/refs.c
+++ b/refs.c
@@ -94,6 +94,7 @@ static void sort_ref_array(struct ref_array *array)
                                die("Duplicated ref, and SHA1s don't match: %s",
                                    a->name);
                        warning("Duplicated ref: %s", a->name);
+                       free(b);
                        continue;
                }
                i++;