aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2011-12-17 10:27:11 (GMT)
committerJouni Malinen <j@w1.fi>2011-12-17 10:27:11 (GMT)
commit9e088e743dbfb8c293b452773519a790a9498d92 (patch)
tree92a08ca255d0c175c4e94a874851839adc0fc570 /src
parent5883168ae0946fd902ad5d938f6bd235f95cde57 (diff)
downloadhostap-9e088e743dbfb8c293b452773519a790a9498d92.zip
hostap-9e088e743dbfb8c293b452773519a790a9498d92.tar.gz
hostap-9e088e743dbfb8c293b452773519a790a9498d92.tar.bz2
nl80211: Fix memory leaks on nla_put_failure error paths
Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/driver_nl80211.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c
index c81fc72..42bf79f 100644
--- a/src/drivers/driver_nl80211.c
+++ b/src/drivers/driver_nl80211.c
@@ -1777,6 +1777,7 @@ static int nl80211_get_noise_for_scan_results(
return send_and_recv_msgs(drv, msg, get_noise_for_scan_results,
scan_res);
nla_put_failure:
+ nlmsg_free(msg);
return -ENOBUFS;
}
@@ -6921,6 +6922,7 @@ static int i802_get_seqnum(const char *iface, void *priv, const u8 *addr,
return send_and_recv_msgs(drv, msg, get_key_handler, seq);
nla_put_failure:
+ nlmsg_free(msg);
return -ENOBUFS;
}
@@ -7011,6 +7013,7 @@ static int i802_flush(void *priv)
return send_and_recv_msgs(drv, msg, NULL, NULL);
nla_put_failure:
+ nlmsg_free(msg);
return -ENOBUFS;
}
@@ -7085,6 +7088,7 @@ static int i802_read_sta_data(void *priv, struct hostap_sta_driver_data *data,
return send_and_recv_msgs(drv, msg, get_sta_handler, data);
nla_put_failure:
+ nlmsg_free(msg);
return -ENOBUFS;
}
@@ -7141,7 +7145,9 @@ static int i802_set_tx_queue_params(void *priv, int queue, int aifs,
if (send_and_recv_msgs(drv, msg, NULL, NULL) == 0)
return 0;
+ msg = NULL;
nla_put_failure:
+ nlmsg_free(msg);
return -1;
}
@@ -7167,6 +7173,7 @@ static int i802_set_sta_vlan(void *priv, const u8 *addr,
if_nametoindex(ifname));
ret = send_and_recv_msgs(drv, msg, NULL, NULL);
+ msg = NULL;
if (ret < 0) {
wpa_printf(MSG_ERROR, "nl80211: NL80211_ATTR_STA_VLAN (addr="
MACSTR " ifname=%s vlan_id=%d) failed: %d (%s)",
@@ -7174,6 +7181,7 @@ static int i802_set_sta_vlan(void *priv, const u8 *addr,
strerror(-ret));
}
nla_put_failure:
+ nlmsg_free(msg);
return ret;
}
@@ -8323,6 +8331,7 @@ static int nl80211_pmkid(struct i802_bss *bss, int cmd, const u8 *bssid,
return send_and_recv_msgs(bss->drv, msg, NULL, NULL);
nla_put_failure:
+ nlmsg_free(msg);
return -ENOBUFS;
}