Fix missing goto out_free; when ipmi_parse_hex() returns (-1)

This commit is contained in:
Zdenek Styblik 2016-07-31 08:56:38 +02:00
parent 34711329c2
commit 2c99bf69ec

View File

@ -499,10 +499,11 @@ ipmi_main(int argc, char ** argv,
break; break;
case 'y': case 'y':
memset(kgkey, 0, sizeof(kgkey)); memset(kgkey, 0, sizeof(kgkey));
rc = ipmi_parse_hex(optarg, kgkey, sizeof(kgkey) - 1);
rc = ipmi_parse_hex(optarg, kgkey, sizeof(kgkey) - 1);
if (rc == -1) { if (rc == -1) {
lprintf(LOG_ERR, "Number of Kg key characters is not even"); lprintf(LOG_ERR, "Number of Kg key characters is not even");
goto out_free;
} else if (rc == -3) { } else if (rc == -3) {
lprintf(LOG_ERR, "Kg key is not hexadecimal number"); lprintf(LOG_ERR, "Kg key is not hexadecimal number");
goto out_free; goto out_free;