]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
RADIUS: Fix possible memory leak when parsing per-STA passphrase
authorAyala Beker <ayala.beker@intel.com>
Thu, 7 Apr 2016 10:30:59 +0000 (13:30 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 8 Apr 2016 08:19:40 +0000 (11:19 +0300)
Fix a possible memory leak in decode_tunnel_passwords() if an invalid
passphrase is received from the RADIUS server.

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
src/ap/ieee802_11_auth.c

index 96091526b9d5c0d1ee46d13bb306e2e43be95e53..b8905373618db9f6e383c2858ca89957f79dd924 100644 (file)
@@ -457,7 +457,7 @@ static void decode_tunnel_passwords(struct hostapd_data *hapd,
 
                if (passphraselen < MIN_PASSPHRASE_LEN ||
                    passphraselen > MAX_PASSPHRASE_LEN + 1)
-                       continue;
+                       goto free_pass;
 
                /*
                 * passphrase does not contain the NULL termination.
@@ -484,6 +484,7 @@ static void decode_tunnel_passwords(struct hostapd_data *hapd,
                }
 skip:
                os_free(psk);
+free_pass:
                os_free(passphrase);
        }
 }