Don't use tmp variable since it's not necessary in ipmi_user_test()

This commit is contained in:
Zdenek Styblik 2014-12-19 08:49:20 +01:00
parent 4d3decc4c0
commit 50bd7d01a8

View File

@ -573,18 +573,13 @@ ipmi_user_test(struct ipmi_intf *intf, int argc, char **argv)
} }
if (argc == 3) { if (argc == 3) {
/* We need to prompt for a password */ /* We need to prompt for a password */
char *tmp;
const char *password_prompt = const char *password_prompt =
ipmi_user_build_password_prompt(user_id); ipmi_user_build_password_prompt(user_id);
# ifdef HAVE_GETPASSPHRASE # ifdef HAVE_GETPASSPHRASE
tmp = getpassphrase(password_prompt); password = getpassphrase(password_prompt);
# else # else
tmp = (char*)getpass(password_prompt); password = (char*)getpass(password_prompt);
# endif # endif
if (tmp != NULL) {
password = strdup(tmp);
tmp = NULL;
}
if (password == NULL) { if (password == NULL) {
lprintf(LOG_ERR, "ipmitool: malloc failure"); lprintf(LOG_ERR, "ipmitool: malloc failure");
return (-1); return (-1);