]> git.ipfire.org Git - thirdparty/git.git/commit
pull: plug minor memory leak after using is_descendant_of()
authorRené Scharfe <l.s.r@web.de>
Fri, 19 Jun 2020 13:14:19 +0000 (15:14 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Jun 2020 19:17:21 +0000 (12:17 -0700)
commit0c9a4f638a53c4b54d5bf91e179d5d915e698272
tree7331eafa588d49533acf4776232b1db69f4b006a
parentaf6b65d45ef179ed52087e80cb089f6b2349f4ec
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>
builtin/pull.c