From 84941606219fe440f59fbbc6057ab3782c09bba4 Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Sun, 26 May 2024 23:42:41 +0200 Subject: [PATCH] quectel/shared: do not leak name string --- src/plugins/quectel/mm-shared-quectel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/quectel/mm-shared-quectel.c b/src/plugins/quectel/mm-shared-quectel.c index 816a570..acd7c3c 100644 --- a/src/plugins/quectel/mm-shared-quectel.c +++ b/src/plugins/quectel/mm-shared-quectel.c @@ -285,8 +285,8 @@ quectel_at_port_get_firmware_revision_ready (MMBaseModem *self, MMFirmwareUpdateSettings *update_settings; MMModemFirmwareUpdateMethod update_methods; const gchar *revision; - const gchar *name; const gchar *id; + gchar *name; g_autoptr(GPtrArray) ids = NULL; GError *error = NULL; @@ -309,6 +309,7 @@ quectel_at_port_get_firmware_revision_ready (MMBaseModem *self, mm_obj_dbg (self, "revision %s converted to modem name %s", revision, name); id = (const gchar *) g_ptr_array_index (ids, 0); g_ptr_array_insert (ids, 0, g_strdup_printf ("%s&NAME_%s", id, name)); + g_free (name); } mm_firmware_update_settings_set_device_ids (update_settings, (const gchar **)ids->pdata); -- 2.45.2