Make sure that git_getpass() never returns NULL

The result of git_getpass() is used without checking for NULL, so let's
just die() instead of returning NULL.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2010-07-23 17:40:44 +02:00
parent 7ee779d156
commit bfd9f9f9fc

View File

@@ -628,8 +628,12 @@ char *git_getpass(const char *prompt)
askpass = getenv("GIT_ASKPASS");
if (!askpass || !(*askpass))
return getpass(prompt);
if (!askpass || !(*askpass)) {
char *result = getpass(prompt);
if (!result)
die_errno("Could not read password");
return result;
}
args[0] = askpass;
args[1] = prompt;