bsd: Fix NULL pointer dereference on error path
The error path in bsd_init() on struct bsd_driver_data allocation was jumping to location where drv is dereferenced. That will crash and it is easier to just return from the function since no cleanup steps are needed in this case. Signed-hostap: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
38bbd06ecf
commit
bfdc2a3172
1 changed files with 2 additions and 2 deletions
|
@ -857,8 +857,8 @@ bsd_init(struct hostapd_data *hapd, struct wpa_init_params *params)
|
||||||
|
|
||||||
drv = os_zalloc(sizeof(struct bsd_driver_data));
|
drv = os_zalloc(sizeof(struct bsd_driver_data));
|
||||||
if (drv == NULL) {
|
if (drv == NULL) {
|
||||||
printf("Could not allocate memory for bsd driver data\n");
|
wpa_printf(MSG_ERROR, "Could not allocate memory for bsd driver data");
|
||||||
goto bad;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
drv->event_buf_len = rtbuf_len();
|
drv->event_buf_len = rtbuf_len();
|
||||||
|
|
Loading…
Reference in a new issue