From 8cb739031d0f129dca2dbefaf0bc38ca33216901 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 6 Dec 2022 14:57:50 +0100 Subject: [PATCH] device: use correct field "l3cfg_" to clear in dispose() The fields "l3cfg" and "l3cfg_" are union aliases. One of them is const, the other is not. The idea is that all places that modify the field need to use the special name "l3cfg_", and grepping for that will lead you to all the relevant places. This mistake happened, because g_clear_object() casts constness away. Fixes: 58287cbcc0c8 ('core: rework IP configuration in NetworkManager using layer 3 configuration') --- src/core/devices/nm-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/devices/nm-device.c b/src/core/devices/nm-device.c index e1569cdbab..5301436855 100644 --- a/src/core/devices/nm-device.c +++ b/src/core/devices/nm-device.c @@ -17891,7 +17891,7 @@ dispose(GObject *object) priv->sriov.next = NULL; } - g_clear_object(&priv->l3cfg); + g_clear_object(&priv->l3cfg_); g_clear_object(&priv->l3ipdata_4.ip_config); g_clear_object(&priv->l3ipdata_6.ip_config);