Skip to content

Commit b240158

Browse files
peffgitster
authored andcommitted
write_entry: fix leak when retrying delayed filter
When write_entry() retries a delayed filter request, we don't need to send the blob content to the filter again, and set the pointer to NULL. But doing so means we leak the contents we read earlier from read_blob_entry(). Let's make sure to free it before dropping the pointer. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 11179eb commit b240158

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

entry.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ static int write_entry(struct cache_entry *ce,
283283
if (dco && dco->state != CE_NO_DELAY) {
284284
/* Do not send the blob in case of a retry. */
285285
if (dco->state == CE_RETRY) {
286+
free(new);
286287
new = NULL;
287288
size = 0;
288289
}

0 commit comments

Comments
 (0)