Skip to content

Commit

Permalink
Merge branch 'jk/credential-plug-leak' into maint
Browse files Browse the repository at this point in the history
An earlier "clean-up" introduced an unnecessary memory leak.

* jk/credential-plug-leak:
  Revert "prompt: clean up strbuf usage"
  • Loading branch information
gitster committed Jan 13, 2014
2 parents ada6ebb + e1c1a32 commit f5678f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion prompt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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)
Expand Down

0 comments on commit f5678f1

Please sign in to comment.