]> git.ipfire.org Git - thirdparty/git.git/commitdiff
reflog: free() ref given to us by dwim_log()
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Fri, 22 Oct 2021 08:55:44 +0000 (10:55 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 23 Oct 2021 17:45:25 +0000 (10:45 -0700)
When dwim_log() returns the "ref" is always ether NULL or an
xstrdup()'d string.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/reflog.c

index bd4c669918d3d0884c015e9e2650bb65ea507d7a..175c83e7cc2804ae841e72ea487cb64fe3d537ae 100644 (file)
@@ -653,6 +653,7 @@ static int cmd_reflog_expire(int argc, const char **argv, const char *prefix)
                                        should_expire_reflog_ent,
                                        reflog_expiry_cleanup,
                                        &cb);
+               free(ref);
        }
        return status;
 }