diff options
author | Junio C Hamano <gitster@pobox.com> | 2014-01-10 10:33:16 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-01-10 10:33:16 -0800 |
commit | 56e648e2534a4eb76713a8843354620599098fa6 (patch) | |
tree | 5c6f3d7937a72f92bc62223b9eb69b9b4eaee8e5 | |
parent | Merge branch 'bs/mirbsd' (diff) | |
parent | Revert "prompt: clean up strbuf usage" (diff) | |
download | tgif-56e648e2534a4eb76713a8843354620599098fa6.tar.xz |
Merge branch 'jk/credential-plug-leak'
An earlier "clean-up" introduced an unnecessary memory leak.
* jk/credential-plug-leak:
Revert "prompt: clean up strbuf usage"
-rw-r--r-- | prompt.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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) |