From d3b93f83ed371c9a289851e16942760c953c37ce Mon Sep 17 00:00:00 2001 From: Richard Hughes Date: Tue, 12 Sep 2017 19:57:08 +0100 Subject: [PATCH] trivial: Fix a small memory leak in fwupd_device_to_string() --- libfwupd/fwupd-device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libfwupd/fwupd-device.c b/libfwupd/fwupd-device.c index ee44f562a..5a386c0e4 100644 --- a/libfwupd/fwupd-device.c +++ b/libfwupd/fwupd-device.c @@ -1106,7 +1106,7 @@ fwupd_device_to_string (FwupdDevice *device) if (priv->flashes_left < 2) fwupd_pad_kv_int (str, FWUPD_RESULT_KEY_DEVICE_FLASHES_LEFT, priv->flashes_left); if (priv->icons->len > 0) { - GString *tmp = g_string_new (NULL); + g_autoptr(GString) tmp = g_string_new (NULL); for (guint i = 0; i < priv->icons->len; i++) { const gchar *icon = g_ptr_array_index (priv->icons, i); g_string_append_printf (tmp, "%s,", icon);