Skip to content

Commit 96b0710

Browse files
steadmongitster
authored andcommitted
object: fix leak of shallow_stat
In eee4502 ("shallow: migrate shallow information into the object parser", 2018-05-17), we added a stat_validity pointer into the parsed_object_pool struct, but did not add code to free this in parsed_object_pool_clear(). This leak was found by fuzz-commit-graph. Clear the struct and then free it in parsed_object_pool_clear() to prevent the leak. Signed-off-by: Josh Steadmon <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 249dc53 commit 96b0710

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

object.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,11 @@ void parsed_object_pool_clear(struct parsed_object_pool *o)
557557
clear_alloc_state(o->commit_state);
558558
clear_alloc_state(o->tag_state);
559559
clear_alloc_state(o->object_state);
560+
stat_validity_clear(o->shallow_stat);
560561
FREE_AND_NULL(o->blob_state);
561562
FREE_AND_NULL(o->tree_state);
562563
FREE_AND_NULL(o->commit_state);
563564
FREE_AND_NULL(o->tag_state);
564565
FREE_AND_NULL(o->object_state);
566+
FREE_AND_NULL(o->shallow_stat);
565567
}

0 commit comments

Comments
 (0)