aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/eapol_test.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-12-19 14:34:41 (GMT)
committerJouni Malinen <j@w1.fi>2009-12-19 14:34:41 (GMT)
commit9e7245bdb414dec167363b9178a37f4745afa595 (patch)
treebcb52c9731b1af430703926c1de98124465afcca /wpa_supplicant/eapol_test.c
parentd94f86d85ef1a846ff91fe3c66b368c1d535352c (diff)
downloadhostap-9e7245bdb414dec167363b9178a37f4745afa595.zip
hostap-9e7245bdb414dec167363b9178a37f4745afa595.tar.gz
hostap-9e7245bdb414dec167363b9178a37f4745afa595.tar.bz2
Change radius_msg_free() to free the buffer
Since all callers were freeing the buffer immediately anyway, move this operation into radius_msg_free() to reduce code size.
Diffstat (limited to 'wpa_supplicant/eapol_test.c')
-rw-r--r--wpa_supplicant/eapol_test.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/wpa_supplicant/eapol_test.c b/wpa_supplicant/eapol_test.c
index 4bac935..a1710e2 100644
--- a/wpa_supplicant/eapol_test.c
+++ b/wpa_supplicant/eapol_test.c
@@ -283,7 +283,6 @@ static void ieee802_1x_encapsulate_radius(struct eapol_test_data *e,
fail:
radius_msg_free(msg);
- os_free(msg);
}
@@ -440,10 +439,8 @@ static void test_eapol_clean(struct eapol_test_data *e,
radius_client_deinit(e->radius);
os_free(e->last_eap_radius);
- if (e->last_recv_radius) {
- radius_msg_free(e->last_recv_radius);
- os_free(e->last_recv_radius);
- }
+ radius_msg_free(e->last_recv_radius);
+ e->last_recv_radius = NULL;
os_free(e->eap_identity);
e->eap_identity = NULL;
eapol_sm_deinit(wpa_s->eapol);
@@ -694,11 +691,7 @@ ieee802_1x_receive_auth(struct radius_msg *msg, struct radius_msg *req,
e->radius_identifier = -1;
wpa_printf(MSG_DEBUG, "RADIUS packet matching with station");
- if (e->last_recv_radius) {
- radius_msg_free(e->last_recv_radius);
- os_free(e->last_recv_radius);
- }
-
+ radius_msg_free(e->last_recv_radius);
e->last_recv_radius = msg;
switch (msg->hdr->code) {