cli: sort_access_points() doesn't take a NULL argument

The device never returns NULL access point list, it only deallocates it on
dispose(). Make this clear for Coverity:

CID 59387 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking aps suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.
This commit is contained in:
Lubomir Rintel 2016-02-04 16:42:00 +01:00
parent 80d9a43a25
commit 1783826856

View file

@ -587,8 +587,10 @@ sort_access_points (const GPtrArray *aps)
GPtrArray *sorted;
int i;
g_return_val_if_fail (aps, NULL);
sorted = g_ptr_array_sized_new (aps->len);
for (i = 0; aps && i < aps->len; i++)
for (i = 0; i < aps->len; i++)
g_ptr_array_add (sorted, aps->pdata[i]);
g_ptr_array_sort_with_data (sorted, compare_aps, NULL);
return sorted;