builtin/grep: fix leaking object context
Even when `get_oid_with_context()` fails it may have allocated some data in the object context. But we do not release it in git-grep(1) when the call fails, leading to a memory leak. Plug it. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
149c83e0aa
commit
ee087c29c8
@ -1133,6 +1133,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)
|
||||
&oid, &oc)) {
|
||||
if (seen_dashdash)
|
||||
die(_("unable to resolve revision: %s"), arg);
|
||||
object_context_release(&oc);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user