From 5cc38d1c6b1d76b1fa93cba021cf6a5472f12fa4 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 5 Jun 2023 13:04:53 +0200 Subject: [PATCH] cloud-setup: clear error variable in nmcs_device_reapply() This is rather bad, because if we reach the "goto again" case, the error variable is not cleared. Subsequently passing the error location to nm_device_reapply_finish() will trigger a glib warning. Fixes: 29b0420be72f ('nm-cloud-setup: set preserve-external-ip flag during reapply') (cherry picked from commit c70a5470be034c660b426ebdbef9e8e67609ece7) (cherry picked from commit 98be3dd5acafa88e7477dcbb9d6420cb2e73ec01) --- src/nm-cloud-setup/nm-cloud-setup-utils.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/nm-cloud-setup/nm-cloud-setup-utils.c b/src/nm-cloud-setup/nm-cloud-setup-utils.c index 7cf7959241..1410ecf7c1 100644 --- a/src/nm-cloud-setup/nm-cloud-setup-utils.c +++ b/src/nm-cloud-setup/nm-cloud-setup-utils.c @@ -833,6 +833,8 @@ nmcs_device_reapply(NMDevice *device, NMDeviceReapplyFlags reapply_flags = NM_DEVICE_REAPPLY_FLAGS_PRESERVE_EXTERNAL_IP; again: + g_clear_error(&data.error); + nm_device_reapply_async(device, connection, version_id,