Skip to content

Commit a2fb767

Browse files
avargitster
authored andcommitted
grep: prefer "struct grep_opt" over its "void *" equivalent
Stylistically fix up code added in bfac23d (grep: Fix two memory leaks, 2010-01-30). We usually don't use the "arg" at all once we've casted it to the struct we want, let's not do that here when we're freeing it. Perhaps it was thought that a cast to "void *" would otherwise be needed? Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 9d530dc commit a2fb767

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

builtin/grep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ static void *run(void *arg)
199199
grep_source_clear_data(&w->source);
200200
work_done(w);
201201
}
202-
free_grep_patterns(arg);
203-
free(arg);
202+
free_grep_patterns(opt);
203+
free(opt);
204204

205205
return (void*) (intptr_t) hit;
206206
}

0 commit comments

Comments
 (0)