avoid null ptr deref

Obtained from:	netbsd
This commit is contained in:
sam 2006-05-27 23:04:30 +00:00
parent ec7bf21638
commit 42150a0d8f

View File

@ -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;
}