avoid null ptr deref
Obtained from: netbsd
This commit is contained in:
parent
ec7bf21638
commit
42150a0d8f
@ -836,12 +836,13 @@ bsd_init(struct hostapd_data *hapd)
|
||||
hapd->driver = &drv->ops;
|
||||
return 0;
|
||||
bad:
|
||||
if (drv->sock_xmit != NULL)
|
||||
l2_packet_deinit(drv->sock_xmit);
|
||||
if (drv->ioctl_sock >= 0)
|
||||
close(drv->ioctl_sock);
|
||||
if (drv != NULL)
|
||||
if (drv != NULL) {
|
||||
if (drv->sock_xmit != NULL)
|
||||
l2_packet_deinit(drv->sock_xmit);
|
||||
if (drv->ioctl_sock >= 0)
|
||||
close(drv->ioctl_sock);
|
||||
free(drv);
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user