]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Fix int_array_concat() to bail out on realloc failure
authorJouni Malinen <j@w1.fi>
Mon, 2 Nov 2009 17:14:17 +0000 (19:14 +0200)
committerJouni Malinen <j@w1.fi>
Mon, 2 Nov 2009 17:14:17 +0000 (19:14 +0200)
The previous version could have ended up dereferencing a NULL pointer
if the reallocation call were to fail.

wpa_supplicant/scan.c

index 770b28d228d85e97ce1cccc7b48e0e4879831d51..1428d328a4c0b202c03d0011772aa823583d9f8c 100644 (file)
@@ -132,6 +132,7 @@ static void int_array_concat(int **res, const int *a)
        if (n == NULL) {
                os_free(*res);
                *res = NULL;
+               return;
        }
        for (i = 0; i <= alen; i++)
                n[reslen + i] = a[i];