Skip to content

Commit 33adc83

Browse files
rscharfegitster
authored andcommitted
refs: plug strbuf leak in lock_ref_sha1_basic()
Don't just reset, but release the resource held by the local variable that is about to go out of scope. Signed-off-by: Rene Scharfe <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent bbcefff commit 33adc83

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

refs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2334,7 +2334,7 @@ static struct ref_lock *lock_ref_sha1_basic(const char *refname,
23342334
struct strbuf err = STRBUF_INIT;
23352335
unable_to_lock_message(ref_file, errno, &err);
23362336
error("%s", err.buf);
2337-
strbuf_reset(&err);
2337+
strbuf_release(&err);
23382338
goto error_return;
23392339
}
23402340
}

0 commit comments

Comments
 (0)