[client] fix minor memory leak in getpasswd() routine caught by the test suite in valgrind mode

This commit is contained in:
Michael Rash
2013-07-18 17:30:25 -04:00
parent f2d829535b
commit 3ee8b47870
+6
View File
@@ -68,6 +68,9 @@ read_passwd_from_stream(FILE *stream)
ptr = ARRAY_FIRST_ELT_ADR(password);
if(stream == NULL)
return password;
#ifdef WIN32
while((c = _getch()) != PW_CR_CHAR)
#else
@@ -192,6 +195,9 @@ getpasswd(const char *prompt, int fd)
_putch(PW_CR_CHAR);
_putch(PW_LF_CHAR);
#endif
fclose(fp);
return (ptr);
}