[PATCH 3/3] clone: use free_refspec() to free refspec list
- Date: Mon, 15 May 2017 03:50:11 -0400
- From: Jeff King <peff@xxxxxxxx>
- Subject: [PATCH 3/3] clone: use free_refspec() to free refspec list
Using free() on a refspec was always leaky, as its string
fields also need freed. But it became more so when ad00f128d
(clone: respect configured fetch respecs during initial
fetch, 2016-03-30) taught clone to create a list of
refspecs, each of which need to be freed.
Signed-off-by: Jeff King <peff@xxxxxxxx>
It's doubtful anyone cares, as this is right before program exit anyway.
But if we're going to bother to free(), we may as well do it right.
builtin/clone.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/builtin/clone.c b/builtin/clone.c
index 645cfa4fd..672c5b0a6 100644
@@ -1144,6 +1144,6 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
junk_mode = JUNK_LEAVE_ALL;
+ free_refspec(refspec_count, refspec);