From 0c9a4f638a53c4b54d5bf91e179d5d915e698272 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ren=C3=A9=20Scharfe?= Date: Fri, 19 Jun 2020 15:14:19 +0200 Subject: [PATCH] pull: plug minor memory leak after using is_descendant_of() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit cmd_pull() builds a commit_list to pass a single potential ancestor to is_descendant_of(). The latter leaves the list intact. Release the allocated memory after the call. Leaking in cmd_*() isn't a big deal, but sets a bad example for other users of is_descendant_of(). Signed-off-by: René Scharfe Acked-by: Jeff King Signed-off-by: Junio C Hamano --- builtin/pull.c | 1 + 1 file changed, 1 insertion(+) diff --git a/builtin/pull.c b/builtin/pull.c index 3e624d1e00..06e5bd48b5 100644 --- a/builtin/pull.c +++ b/builtin/pull.c @@ -994,6 +994,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix) opt_ff = "--ff-only"; ret = run_merge(); } + free_commit_list(list); } ret = run_rebase(&curr_head, merge_heads.oid, &rebase_fork_point); -- 2.11.4.GIT