Skip to content

Commit 90f81f9

Browse files
committed
transports: local: fix memory leak in reference walk
Upon downloading the pack file, the local transport will iterate through every reference using `git_reference_foreach`. The function is a bit tricky though in that it requires the passed callback to free the references, which does not currently happen. Fix the memory leak by freeing all passed references in the callback.
1 parent 093e671 commit 90f81f9

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/transports/local.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,8 @@ static int foreach_reference_cb(git_reference *reference, void *payload)
519519
error = 0;
520520
}
521521

522+
git_reference_free(reference);
523+
522524
return error;
523525
}
524526

0 commit comments

Comments
 (0)