mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 19:00:11 +01:00
core: avoid coverity warning in device factory's _add_factory() (3)
2. NetworkManager-1.9.2/src/devices/nm-device-factory.c:312: returned_pointer: Assigning value from "g_slist_append(list, g_object_ref(factory))" to "list" here, but that stored value is overwritten before it can be used. Fixes:98afc76184Fixes:449940af1d
This commit is contained in:
parent
d0d962d3d1
commit
7f84f15e06
1 changed files with 5 additions and 4 deletions
|
|
@ -295,7 +295,7 @@ _add_factory (NMDeviceFactory *factory,
|
|||
{
|
||||
const NMLinkType *link_types = NULL;
|
||||
const char *const*setting_types = NULL;
|
||||
GSList *list;
|
||||
GSList *list, *list2;
|
||||
int i;
|
||||
|
||||
g_return_val_if_fail (factories_by_link, FALSE);
|
||||
|
|
@ -308,9 +308,10 @@ _add_factory (NMDeviceFactory *factory,
|
|||
g_hash_table_insert (factories_by_link, GUINT_TO_POINTER (link_types[i]), g_object_ref (factory));
|
||||
for (i = 0; setting_types && setting_types[i]; i++) {
|
||||
list = g_hash_table_lookup (factories_by_setting, (char *) setting_types[i]);
|
||||
if (list)
|
||||
(void) g_slist_append (list, g_object_ref (factory));
|
||||
else {
|
||||
if (list) {
|
||||
list2 = g_slist_append (list, g_object_ref (factory));
|
||||
nm_assert (list == list2);
|
||||
} else {
|
||||
list = g_slist_append (list, g_object_ref (factory));
|
||||
g_hash_table_insert (factories_by_setting, (char *) setting_types[i], list);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue