Skip to content

Commit 46f6ca2

Browse files
pks-tgitster
authored andcommitted
builtin/repack: fix leaking keep-pack list
The list of packs to keep is populated via a command line option but never free'd. Plug this memory leak. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ed78f04 commit 46f6ca2

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

builtin/repack.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1525,6 +1525,7 @@ int cmd_repack(int argc, const char **argv, const char *prefix)
15251525
}
15261526

15271527
cleanup:
1528+
string_list_clear(&keep_pack_list, 0);
15281529
string_list_clear(&names, 1);
15291530
existing_packs_release(&existing);
15301531
free_pack_geometry(&geometry);

t/t6500-gc.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
test_description='basic git gc tests
44
'
55

6+
TEST_PASSES_SANITIZE_LEAK=true
67
. ./test-lib.sh
78
. "$TEST_DIRECTORY"/lib-terminal.sh
89

t/t7703-repack-geometric.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
test_description='git repack --geometric works correctly'
44

5+
TEST_PASSES_SANITIZE_LEAK=true
56
. ./test-lib.sh
67

78
GIT_TEST_MULTI_PACK_INDEX=0

0 commit comments

Comments
 (0)