mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 10:44:12 +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;
|
||||
}
|
||||
|
||||
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
|
||||
fu_redfish_backend_setup(FuBackend *backend, GError **error)
|
||||
{
|
||||
@ -339,7 +350,7 @@ fu_redfish_backend_setup(FuBackend *backend, GError **error)
|
||||
"no @odata.id string");
|
||||
return FALSE;
|
||||
}
|
||||
self->update_uri_path = g_strdup(data_id);
|
||||
fu_redfish_backend_set_update_uri_path(self, data_id);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user