summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-01-13 11:23:01 -0800
committerJunio C Hamano <gitster@pobox.com>2014-01-13 11:23:01 -0800
commitf5678f133321c4873109d15fd9ee4612cc326e13 (patch)
treec0384d9346cdad679b86db73fe01d5e4a6af79dc
parentada6ebb6e9525d6cd0ce954edc04123d15a8650b (diff)
parente1c1a324fc7061c8f170a113709724f1640addb3 (diff)
downloadgit-f5678f133321c4873109d15fd9ee4612cc326e13.tar.gz
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"
-rw-r--r--prompt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/prompt.c b/prompt.c
index d851807feb..d7bb17cb66 100644
--- a/prompt.c
+++ b/prompt.c
@@ -22,6 +22,7 @@ static char *do_askpass(const char *cmd, const char *prompt)
if (start_command(&pass))
return NULL;
+ strbuf_reset(&buffer);
if (strbuf_read(&buffer, pass.out, 20) < 0)
err = 1;
@@ -38,7 +39,7 @@ static char *do_askpass(const char *cmd, const char *prompt)
strbuf_setlen(&buffer, strcspn(buffer.buf, "\r\n"));
- return strbuf_detach(&buffer, NULL);
+ return buffer.buf;
}
char *git_prompt(const char *prompt, int flags)