]> git.proxmox.com Git - fwupd.git/commitdiff
trivial: Fix memory leak when incorporating FuMeiDevice
authorRichard Hughes <richard@hughsie.com>
Sat, 19 Nov 2022 11:06:23 +0000 (11:06 +0000)
committerRichard Hughes <richard@hughsie.com>
Sat, 19 Nov 2022 12:59:30 +0000 (12:59 +0000)
libfwupdplugin/fu-mei-device.c

index 7565ee23bd213aa9daa42c8a75cf2c000cddd3f7..1abf201b3a462df19efc02d36f78729f9728ea57 100644 (file)
@@ -472,8 +472,10 @@ fu_mei_device_incorporate(FuDevice *device, FuDevice *donor)
        /* copy private instance data */
        priv->max_msg_length = priv_donor->max_msg_length;
        priv->protocol_version = priv_donor->protocol_version;
-       priv->uuid = g_strdup(priv_donor->uuid);
-       priv->parent_device_file = g_strdup(priv_donor->parent_device_file);
+       if (priv->uuid == NULL)
+               priv->uuid = g_strdup(priv_donor->uuid);
+       if (priv->parent_device_file == NULL)
+               priv->parent_device_file = g_strdup(priv_donor->parent_device_file);
 }
 
 static void