mirror of
https://github.com/ipmitool/ipmitool.git
synced 2025-05-10 10:37:22 +00:00
ID: 3613605 - 'lib/ipmi_main.c' - call free() on pointer to static data
getpass() and getpassphrase() library functions return pointer to a static data array. When free() is called on such pointer, it abnormally terminates application. Commit for Dmitry Bazhenov
This commit is contained in:
parent
44247a8743
commit
51dd9cf1f0
@ -504,7 +504,6 @@ ipmi_main(int argc, char ** argv,
|
||||
password = NULL;
|
||||
}
|
||||
password = strdup(tmp_pass);
|
||||
free(tmp_pass);
|
||||
tmp_pass = NULL;
|
||||
if (password == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
@ -560,7 +559,6 @@ ipmi_main(int argc, char ** argv,
|
||||
kgkey = NULL;
|
||||
}
|
||||
kgkey = strdup(tmp_pass);
|
||||
free(tmp_pass);
|
||||
tmp_pass = NULL;
|
||||
if (kgkey == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
@ -794,7 +792,6 @@ ipmi_main(int argc, char ** argv,
|
||||
#endif
|
||||
if (tmp_pass != NULL) {
|
||||
password = strdup(tmp_pass);
|
||||
free(tmp_pass);
|
||||
tmp_pass = NULL;
|
||||
if (password == NULL) {
|
||||
lprintf(LOG_ERR, "%s: malloc failure", progname);
|
||||
|
Loading…
x
Reference in New Issue
Block a user