From 0e32d4b31f35d36dc78bb26fefac221605ca3e60 Mon Sep 17 00:00:00 2001 From: Stefan Beller Date: Mon, 30 Mar 2015 18:22:09 -0700 Subject: wt-status.c: fix a memleak wt_shortstatus_print_tracking() calls shorten_unambiguous_ref(), which returns a newly allocated memory the caller takes ownership of; it is necessary to free `base` when the function is done with it. Signed-off-by: Stefan Beller Signed-off-by: Junio C Hamano --- wt-status.c | 1 + 1 file changed, 1 insertion(+) diff --git a/wt-status.c b/wt-status.c index ec7344e508..3ec4383ae9 100644 --- a/wt-status.c +++ b/wt-status.c @@ -1541,6 +1541,7 @@ static void wt_shortstatus_print_tracking(struct wt_status *s) base = shorten_unambiguous_ref(base, 0); color_fprintf(s->fp, header_color, "..."); color_fprintf(s->fp, branch_color_remote, "%s", base); + free((char *)base); if (!upstream_is_gone && !num_ours && !num_theirs) { fputc(s->null_termination ? '\0' : '\n', s->fp); -- cgit v1.2.1