]> git.ipfire.org Git - thirdparty/git.git/commit
revision: fix memory leak in prepare_show_merge()
authorLidong Yan <502024330056@smail.nju.edu.cn>
Tue, 10 Jun 2025 00:37:59 +0000 (00:37 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 10 Jun 2025 03:41:17 +0000 (20:41 -0700)
commita3d278bb6457fa33461891a8f0a4ccffaf0f5296
tree4779e46a733530587537cfa27f5ff2ae1c40052e
parentd50a5e8939abfc07c2ff97ae72e9330939b36ee0
revision: fix memory leak in prepare_show_merge()

In revision.c:prepare_show_merge(), we allocated an array in prune
but forget to free it. Since parse_pathspec is not responsible to
free prune, we should add `free(prune)` in the end of prepare_show_merge().

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c
t/t7007-show.sh