From: Masashi Honma Date: Tue, 23 Nov 2010 23:42:50 +0000 (+0200) Subject: Fix memory leak on EAPOL Authenticator error path X-Git-Tag: hostap-1-bp~745 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=dbb6ed7e752da8e5d563705afe6a1848d23f4052;p=thirdparty%2Fhostap.git Fix memory leak on EAPOL Authenticator error path wlan0: RADIUS No authentication server configured MEMLEAK[0x999feb8]: len 1040 WPA_TRACE: memleak - START [3]: ./hostapd(radius_msg_new+0x33) [0x8074f43] radius_msg_new() ../src/radius/radius.c:117 [4]: ./hostapd() [0x806095e] ieee802_1x_encapsulate_radius() ../src/ap/ieee802_1x.c:439 ieee802_1x_aaa_send() ../src/ap/ieee802_1x.c:1496 For example, this error occured when I used WPS hostapd without "eap_server=1" definition in configuration file. --- diff --git a/src/ap/ieee802_1x.c b/src/ap/ieee802_1x.c index 0c86017de..35bb187ca 100644 --- a/src/ap/ieee802_1x.c +++ b/src/ap/ieee802_1x.c @@ -551,7 +551,9 @@ static void ieee802_1x_encapsulate_radius(struct hostapd_data *hapd, } } - radius_client_send(hapd->radius, msg, RADIUS_AUTH, sta->addr); + if (radius_client_send(hapd->radius, msg, RADIUS_AUTH, sta->addr) < 0) + goto fail; + return; fail: