mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-02-04 09:30:31 +01:00
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:
parent
80d9a43a25
commit
1783826856
1 changed files with 3 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue