Skip to content
This repository was archived by the owner on Nov 9, 2017. It is now read-only.

Commit f5678f1

Browse files
committed
Merge branch 'jk/credential-plug-leak' into maint
An earlier "clean-up" introduced an unnecessary memory leak. * jk/credential-plug-leak: Revert "prompt: clean up strbuf usage"
2 parents ada6ebb + e1c1a32 commit f5678f1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

prompt.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ static char *do_askpass(const char *cmd, const char *prompt)
2222
if (start_command(&pass))
2323
return NULL;
2424

25+
strbuf_reset(&buffer);
2526
if (strbuf_read(&buffer, pass.out, 20) < 0)
2627
err = 1;
2728

@@ -38,7 +39,7 @@ static char *do_askpass(const char *cmd, const char *prompt)
3839

3940
strbuf_setlen(&buffer, strcspn(buffer.buf, "\r\n"));
4041

41-
return strbuf_detach(&buffer, NULL);
42+
return buffer.buf;
4243
}
4344

4445
char *git_prompt(const char *prompt, int flags)

0 commit comments

Comments
 (0)