Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2020-06-19 16:14:19 +0300
committerJunio C Hamano <gitster@pobox.com>2020-06-19 22:17:21 +0300
commit0c9a4f638a53c4b54d5bf91e179d5d915e698272 (patch)
tree7331eafa588d49533acf4776232b1db69f4b006a /builtin/pull.c
parentaf6b65d45ef179ed52087e80cb089f6b2349f4ec (diff)
pull: plug minor memory leak after using is_descendant_of()
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 <l.s.r@web.de> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/pull.c')
-rw-r--r--builtin/pull.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/pull.c b/builtin/pull.c
index 3e624d1e008..06e5bd48b55 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);