Skip to content

Commit bfac23d

Browse files
toofishesgitster
authored andcommitted
grep: Fix two memory leaks
We duplicate the grep_opt structure when using grep threads, but didn't later free either the patterns attached to this new structure or the structure itself. Signed-off-by: Dan McGee <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 31d8738 commit bfac23d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin-grep.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ static void *run(void *arg)
205205

206206
work_done(w);
207207
}
208+
free_grep_patterns(arg);
209+
free(arg);
208210

209211
return (void*) (intptr_t) hit;
210212
}

0 commit comments

Comments
 (0)