]> git.ipfire.org Git - thirdparty/git.git/commitdiff
sparse-checkout: fix a couple minor memory leaks
authorElijah Newren <newren@gmail.com>
Fri, 28 Jan 2022 01:58:18 +0000 (01:58 +0000)
committerJunio C Hamano <gitster@pobox.com>
Fri, 28 Jan 2022 21:09:55 +0000 (13:09 -0800)
These were introduced in commit 55dfcf9591 ("sparse-checkout: clear
tracked sparse dirs", 2021-09-08) and missed in my review at the time.
Plug the leaks.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/sparse-checkout.c

index d0f5c4702be69d0c9fade08ffbf5183c5f3dbe7e..23482d77c9832f6072f4e31331fc0fe24ef2503c 100644 (file)
@@ -182,6 +182,8 @@ static void clean_tracked_sparse_directories(struct repository *r)
                                item->string);
                }
 
+               strvec_clear(&s);
+               clear_pathspec(&p);
                dir_clear(&dir);
        }