diff options
author | sam <sam@FreeBSD.org> | 2006-05-27 23:04:30 +0000 |
---|---|---|
committer | sam <sam@FreeBSD.org> | 2006-05-27 23:04:30 +0000 |
commit | 42150a0d8f2e41530ab80969d2bfb4169fefc619 (patch) | |
tree | 84a63f28821867e0986cac6d9f96aa4574e0888e /usr.sbin | |
parent | ec7bf216388edfa9ee6c4239b4125aeb622d5f23 (diff) | |
download | FreeBSD-src-42150a0d8f2e41530ab80969d2bfb4169fefc619.zip FreeBSD-src-42150a0d8f2e41530ab80969d2bfb4169fefc619.tar.gz |
avoid null ptr deref
Obtained from: netbsd
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/wpa/hostapd/driver_freebsd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/usr.sbin/wpa/hostapd/driver_freebsd.c b/usr.sbin/wpa/hostapd/driver_freebsd.c index 6c0cf67..683b01f 100644 --- a/usr.sbin/wpa/hostapd/driver_freebsd.c +++ b/usr.sbin/wpa/hostapd/driver_freebsd.c @@ -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; } |