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>
René Scharfe committed
Jun 19, 2020 at 15:14 UTC
0c9a4f638a53c4b54d5bf91e179d5d915e698272
1 file changed
+1
builtin/pull.c
+1
@@ -994,6 +994,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
994
opt_ff = "--ff-only";
995
ret = run_merge();
996
}
997
+ free_commit_list(list);
998
}
999
ret = run_rebase(&curr_head, merge_heads.oid, &rebase_fork_point);
1000