From: Stefan Beller Date: Tue, 31 Mar 2015 01:22:09 +0000 (-0700) Subject: wt-status.c: fix a memleak X-Git-Tag: v2.4.0-rc2~7^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e32d4b31f35d36dc78bb26fefac221605ca3e60;p=thirdparty%2Fgit.git 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 --- 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);