mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-16 12:20:05 +00:00
redfish: Fix a memory leak when calling ->setup() more than once
This commit is contained in:
parent
a8497ad5c2
commit
08a3fd8b65
@ -284,6 +284,17 @@ fu_redfish_backend_coldplug(FuBackend *backend, GError **error)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
fu_redfish_backend_set_update_uri_path(FuRedfishBackend *self, const gchar *update_uri_path)
|
||||||
|
{
|
||||||
|
/* not changed */
|
||||||
|
if (g_strcmp0(self->update_uri_path, update_uri_path) == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
g_free(self->update_uri_path);
|
||||||
|
self->update_uri_path = g_strdup(update_uri_path);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
fu_redfish_backend_setup(FuBackend *backend, GError **error)
|
fu_redfish_backend_setup(FuBackend *backend, GError **error)
|
||||||
{
|
{
|
||||||
@ -339,7 +350,7 @@ fu_redfish_backend_setup(FuBackend *backend, GError **error)
|
|||||||
"no @odata.id string");
|
"no @odata.id string");
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
self->update_uri_path = g_strdup(data_id);
|
fu_redfish_backend_set_update_uri_path(self, data_id);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user