diff mbox series

[v2,6/6] reflog: free() ref given to us by dwim_log()

Message ID patch-v2-6.6-6ea5e611ae0-20211022T085306Z-avarab@gmail.com (mailing list archive)
State Accepted
Commit 3c8150497f3c77a2c57e73c53bd3de933b85d9a3
Headers show
Series leaks: miscellaneous small leak fixes | expand

Commit Message

Ævar Arnfjörð Bjarmason Oct. 22, 2021, 8:55 a.m. UTC
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>
---
 builtin/reflog.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/builtin/reflog.c b/builtin/reflog.c
index bd4c669918d..175c83e7cc2 100644
--- a/builtin/reflog.c
+++ b/builtin/reflog.c
@@ -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;
 }