Skip to content

Commit 1cf58e7

Browse files
sigprofJunio C Hamano
authored andcommitted
[PATCH] Plug memory leak in read_object_with_reference()
When following a reference, read_object_with_reference() did not free the intermediate object data. Signed-off-by: Sergey Vlasov <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 35c3c62 commit 1cf58e7

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sha1_file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,7 @@ void *read_object_with_reference(const unsigned char *sha1,
11651165
free(buffer);
11661166
return NULL;
11671167
}
1168+
free(buffer);
11681169
/* Now we have the ID of the referred-to object in
11691170
* actual_sha1. Check again. */
11701171
}

0 commit comments

Comments
 (0)