mirror of
https://github.com/vanhoefm/fragattacks.git
synced 2024-11-25 00:38:24 -05:00
wpa_supplicant: Free config only if it was allocated in same call
If option -I:config points to a non-existing file, the the previously allocated config must not be freed. Avoid use of freed memory in such an error case by skipping the incorrect freeing operation. Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
parent
946ed13c98
commit
9c5fe742a2
@ -397,7 +397,8 @@ struct wpa_config * wpa_config_read(const char *name, struct wpa_config *cfgp)
|
||||
if (f == NULL) {
|
||||
wpa_printf(MSG_ERROR, "Failed to open config file '%s', "
|
||||
"error: %s", name, strerror(errno));
|
||||
os_free(config);
|
||||
if (config != cfgp)
|
||||
os_free(config);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user