Browse Source

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 <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Dan McGee 15 years ago committed by Junio C Hamano
parent
commit
bfac23d953
  1. 2
      builtin-grep.c

2
builtin-grep.c

@ -205,6 +205,8 @@ static void *run(void *arg) @@ -205,6 +205,8 @@ static void *run(void *arg)

work_done(w);
}
free_grep_patterns(arg);
free(arg);

return (void*) (intptr_t) hit;
}

Loading…
Cancel
Save