]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix memory leak on error path in bssid_filter setting
authorJouni Malinen <j@w1.fi>
Sun, 19 Feb 2012 12:28:02 +0000 (14:28 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 19 Feb 2012 12:28:02 +0000 (14:28 +0200)
Signed-hostap: Jouni Malinen <j@w1.fi>

wpa_supplicant/ctrl_iface.c

index 9d1afbe4b87b632a333f3bd7fa3fcdfc03b88937..d623e91b938222d62fbd2a9cef10a8730ca11d97 100644 (file)
@@ -124,8 +124,10 @@ static int set_bssid_filter(struct wpa_supplicant *wpa_s, char *val)
        while (pos) {
                if (*pos == '\0')
                        break;
-               if (hwaddr_aton(pos, addr))
+               if (hwaddr_aton(pos, addr)) {
+                       os_free(filter);
                        return -1;
+               }
                n = os_realloc(filter, (count + 1) * ETH_ALEN);
                if (n == NULL) {
                        os_free(filter);