aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/driver_bsd.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-01-07 13:58:01 (GMT)
committerJouni Malinen <j@w1.fi>2014-01-07 13:58:01 (GMT)
commitbfdc2a3172567dc7a77920557cbdb64d55d471bc (patch)
treeae0bb89745d70e9e08b1b1191a7d4f64d1d11fc2 /src/drivers/driver_bsd.c
parent38bbd06ecff13b473e854f34719a1a36632fb5f4 (diff)
downloadhostap-bfdc2a3172567dc7a77920557cbdb64d55d471bc.zip
hostap-bfdc2a3172567dc7a77920557cbdb64d55d471bc.tar.gz
hostap-bfdc2a3172567dc7a77920557cbdb64d55d471bc.tar.bz2
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>
Diffstat (limited to 'src/drivers/driver_bsd.c')
-rw-r--r--src/drivers/driver_bsd.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/drivers/driver_bsd.c b/src/drivers/driver_bsd.c
index 097e7d6..71c9ce9 100644
--- a/src/drivers/driver_bsd.c
+++ b/src/drivers/driver_bsd.c
@@ -857,8 +857,8 @@ bsd_init(struct hostapd_data *hapd, struct wpa_init_params *params)
drv = os_zalloc(sizeof(struct bsd_driver_data));
if (drv == NULL) {
- printf("Could not allocate memory for bsd driver data\n");
- goto bad;
+ wpa_printf(MSG_ERROR, "Could not allocate memory for bsd driver data");
+ return NULL;
}
drv->event_buf_len = rtbuf_len();