Skip to content

Commit 372b050

Browse files
committed
replace: plug a memory leak
Recent update to for_each_replace_name() to make it use a strbuf in place of a fixed buffer forgot to release the memory held by the strbuf before leaving the function. Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6a97da3 commit 372b050

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

builtin/replace.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ static int for_each_replace_name(const char **argv, each_replace_name_fn fn)
120120
if (fn(full_hex, ref.buf, &oid))
121121
had_error = 1;
122122
}
123+
strbuf_release(&ref);
123124
return had_error;
124125
}
125126

0 commit comments

Comments
 (0)