From 1846b36fb291d110c64e83b515d41b02a8d79480 Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Thu, 12 May 2022 11:58:22 +0100 Subject: [PATCH] dfu: Fix a trivial memory leak introduced in the last commit --- plugins/dfu/fu-dfu-target.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/dfu/fu-dfu-target.c b/plugins/dfu/fu-dfu-target.c index ece946367af7..a334e6c7b2ec 100644 --- a/plugins/dfu/fu-dfu-target.c +++ b/plugins/dfu/fu-dfu-target.c @@ -621,9 +621,9 @@ fu_dfu_target_setup(FuDfuTarget *self, GError **error) /* get string */ if (priv->alt_idx != 0x00 && fu_device_get_logical_id(FU_DEVICE(self)) == NULL) { GUsbDevice *usb_device = fu_usb_device_get_dev(FU_USB_DEVICE(device)); - fu_device_set_logical_id( - FU_DEVICE(self), - g_usb_device_get_string_descriptor(usb_device, priv->alt_idx, NULL)); + g_autofree gchar *alt_name = NULL; + alt_name = g_usb_device_get_string_descriptor(usb_device, priv->alt_idx, NULL); + fu_device_set_logical_id(FU_DEVICE(self), alt_name); } /* parse the DfuSe format according to UM0424 */