trivial: Fix a small memory leak when getting the udev parent

This commit is contained in:
Richard Hughes 2022-03-25 19:57:13 +00:00
parent 1241e156b9
commit c1ff3e67af

View File

@ -1922,8 +1922,7 @@ fu_udev_device_get_parent_with_subsystem(FuUdevDevice *self, const gchar *subsys
device_tmp = g_udev_device_get_parent_with_subsystem(priv->udev_device, subsystem, NULL); device_tmp = g_udev_device_get_parent_with_subsystem(priv->udev_device, subsystem, NULL);
if (device_tmp == NULL) if (device_tmp == NULL)
return NULL; return NULL;
return fu_udev_device_new_with_context(fu_device_get_context(FU_DEVICE(self)), return fu_udev_device_new_with_context(fu_device_get_context(FU_DEVICE(self)), device_tmp);
g_steal_pointer(&device_tmp));
#else #else
return NULL; return NULL;
#endif #endif