From: Samo Pogačnik Date: Sun, 15 Feb 2026 20:11:55 +0000 (+0000) Subject: shallow: free local object_array allocations X-Git-Tag: v2.54.0-rc0~124^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d0abfb048fe0a069a4d3cd42fdd0c99afec141c4;p=thirdparty%2Fgit.git shallow: free local object_array allocations The local object_array 'stack' in get_shallow_commits() function does not free its dynamic elements before the function returns. As a result elements remain allocated and their reference forgotten. Also note, that test 'fetching deepen beyond merged branch' added by 'shallow: handling fetch relative-deepen' patch fails without this correction in linux-leaks and linux-reftable-leaks test runs. Signed-off-by: Samo Pogačnik Signed-off-by: Junio C Hamano --- diff --git a/shallow.c b/shallow.c index 186e9178f3..d37d2bc179 100644 --- a/shallow.c +++ b/shallow.c @@ -198,6 +198,7 @@ struct commit_list *get_shallow_commits(struct object_array *heads, int depth, } } deep_clear_commit_depth(&depths, free_depth_in_slab); + object_array_clear(&stack); return result; }