зеркало из https://github.com/microsoft/git.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 <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
e156455ea4
Коммит
0e32d4b31f
|
@ -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);
|
||||
|
|
Загрузка…
Ссылка в новой задаче