diff mbox

[1/3] ACL: Fix possible memory leak

Message ID 1460025062-18347-1-git-send-email-ilan.peer@intel.com
State Accepted
Headers show

Commit Message

Ilan Peer April 7, 2016, 10:30 a.m. UTC
From: Ayala Beker <ayala.beker@intel.com>

Fix possible memory leak in decode_tunnel_passwords().

Signed-off-by: Ayala Beker <ayala.beker@intel.com>
---
 src/ap/ieee802_11_auth.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Jouni Malinen April 8, 2016, 12:49 p.m. UTC | #1
Thanks, all three patches applied.
diff mbox

Patch

diff --git a/src/ap/ieee802_11_auth.c b/src/ap/ieee802_11_auth.c
index 9609152..b890537 100644
--- a/src/ap/ieee802_11_auth.c
+++ b/src/ap/ieee802_11_auth.c
@@ -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);
 	}
 }