From: Jouni Malinen Date: Mon, 2 Nov 2009 17:14:17 +0000 (+0200) Subject: Fix int_array_concat() to bail out on realloc failure X-Git-Tag: hostap_0_7_0~105 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e6c0ebff681c08ba6a42b043700cc70e998fe5f3;p=thirdparty%2Fhostap.git Fix int_array_concat() to bail out on realloc failure The previous version could have ended up dereferencing a NULL pointer if the reallocation call were to fail. --- diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 770b28d22..1428d328a 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -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];