From e1667650f428fb8e5c5ff2d1a8eb93ff1d28e1ac Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Thu, 16 Sep 2021 09:15:04 +0200 Subject: [PATCH] l3cfg: fix leak of ObjStateData's os_plobj Fixes: 6b92c8948656 ('l3cfg: track platform object in NML3Cfg's object state') --- src/core/nm-l3cfg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/nm-l3cfg.c b/src/core/nm-l3cfg.c index ce3b56f312..45646e98fa 100644 --- a/src/core/nm-l3cfg.c +++ b/src/core/nm-l3cfg.c @@ -670,6 +670,7 @@ _obj_state_data_free(gpointer data) c_list_unlink_stale(&obj_state->os_lst); c_list_unlink_stale(&obj_state->os_temporary_not_available_lst); nmp_object_unref(obj_state->obj); + nmp_object_unref(obj_state->os_plobj); nm_g_slice_free(obj_state); } @@ -786,7 +787,7 @@ _obj_states_externally_removed_track(NML3Cfg *self, const NMPObject *obj, gboole nm_assert(c_list_is_empty(&obj_state->os_zombie_lst)); if (in_platform) { - obj_state->os_plobj = nmp_object_ref(obj); + nmp_object_ref_set(&obj_state->os_plobj, obj); obj_state->os_was_in_platform = TRUE; _LOGD("obj-state: appeared in platform: %s", _obj_state_data_to_string(obj_state, sbuf, sizeof(sbuf)));