Browse Source

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.
Jouni Malinen 15 years ago
parent
commit
e6c0ebff68
1 changed files with 1 additions and 0 deletions
  1. 1 0
      wpa_supplicant/scan.c

+ 1 - 0
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];