From 06f06dbf0c62d9b347eca0ab6bcdaa1c49581771 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Fri, 19 Oct 2018 15:37:32 +0200 Subject: [PATCH] platform/tests: don't compare dangling pointer in "test-nmp-object.c" This wouldn't even dereference the dangling pointer, but merely comparing it for pointer equality. Still, it's actually undefined behavior. Avoid it. (cherry picked from commit cfc056560461c9444177c3b4f333e395c2cab5df) --- src/platform/tests/test-nmp-object.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/platform/tests/test-nmp-object.c b/src/platform/tests/test-nmp-object.c index 047d7a854b..004ea2739a 100644 --- a/src/platform/tests/test-nmp-object.c +++ b/src/platform/tests/test-nmp-object.c @@ -587,7 +587,7 @@ main (int argc, char **argv) while (global.udev_devices) { udev_device_unref (global.udev_devices->data); - global.udev_devices = g_list_remove (global.udev_devices, global.udev_devices->data); + global.udev_devices = g_list_delete_link (global.udev_devices, global.udev_devices); } nm_udev_client_unref (udev_client);