Skip to content

Commit 23941dd

Browse files
telezhnayagitster
authored andcommitted
ref-filter: free memory from used_atom
Release memory from used_atom variable for reducing number of memory leaks. Signed-off-by: Olga Telezhnaia <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5a0cc8a commit 23941dd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

ref-filter.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1996,6 +1996,10 @@ void ref_array_clear(struct ref_array *array)
19961996
{
19971997
int i;
19981998

1999+
for (i = 0; i < used_atom_cnt; i++)
2000+
free((char *)used_atom[i].name);
2001+
FREE_AND_NULL(used_atom);
2002+
used_atom_cnt = 0;
19992003
for (i = 0; i < array->nr; i++)
20002004
free_array_item(array->items[i]);
20012005
FREE_AND_NULL(array->items);

0 commit comments

Comments
 (0)