Skip to content

Commit 0c9a4f6

Browse files
rscharfegitster
authored andcommitted
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 <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent af6b65d commit 0c9a4f6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin/pull.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -994,6 +994,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
994994
opt_ff = "--ff-only";
995995
ret = run_merge();
996996
}
997+
free_commit_list(list);
997998
}
998999
ret = run_rebase(&curr_head, merge_heads.oid, &rebase_fork_point);
9991000

0 commit comments

Comments
 (0)