mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 07:09:57 +00:00
dell: Fix the last of the memory leaks in the self tests
Fixes: https://github.com/hughsie/fwupd/issues/158
This commit is contained in:
parent
4bfcae2921
commit
f592b06722
@ -40,7 +40,7 @@ static void
|
|||||||
_plugin_device_added_cb (FuPlugin *plugin, FuDevice *device, gpointer user_data)
|
_plugin_device_added_cb (FuPlugin *plugin, FuDevice *device, gpointer user_data)
|
||||||
{
|
{
|
||||||
FuDevice **dev = (FuDevice **) user_data;
|
FuDevice **dev = (FuDevice **) user_data;
|
||||||
*dev = g_object_ref (device);
|
g_set_object (dev, device);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -117,6 +117,7 @@ fu_plugin_dell_tpm_func (void)
|
|||||||
/* cleanup */
|
/* cleanup */
|
||||||
fu_plugin_device_remove (plugin, device_alt);
|
fu_plugin_device_remove (plugin, device_alt);
|
||||||
fu_plugin_device_remove (plugin, device);
|
fu_plugin_device_remove (plugin, device);
|
||||||
|
g_clear_object (&device);
|
||||||
|
|
||||||
/* inject fake data:
|
/* inject fake data:
|
||||||
* - that hasflashes
|
* - that hasflashes
|
||||||
@ -148,6 +149,7 @@ fu_plugin_dell_tpm_func (void)
|
|||||||
/* cleanup */
|
/* cleanup */
|
||||||
fu_plugin_device_remove (plugin, device_alt);
|
fu_plugin_device_remove (plugin, device_alt);
|
||||||
fu_plugin_device_remove (plugin, device);
|
fu_plugin_device_remove (plugin, device);
|
||||||
|
g_clear_object (&device);
|
||||||
|
|
||||||
/* inject fake data:
|
/* inject fake data:
|
||||||
* - that has flashes
|
* - that has flashes
|
||||||
@ -186,6 +188,7 @@ fu_plugin_dell_tpm_func (void)
|
|||||||
/* cleanup */
|
/* cleanup */
|
||||||
fu_plugin_device_remove (plugin, device_alt);
|
fu_plugin_device_remove (plugin, device_alt);
|
||||||
fu_plugin_device_remove (plugin, device);
|
fu_plugin_device_remove (plugin, device);
|
||||||
|
g_clear_object (&device);
|
||||||
|
|
||||||
/* inject fake data:
|
/* inject fake data:
|
||||||
* - that has 1 flash left
|
* - that has 1 flash left
|
||||||
@ -227,6 +230,7 @@ fu_plugin_dell_tpm_func (void)
|
|||||||
/* cleanup */
|
/* cleanup */
|
||||||
fu_plugin_device_remove (plugin, device_alt);
|
fu_plugin_device_remove (plugin, device_alt);
|
||||||
fu_plugin_device_remove (plugin, device);
|
fu_plugin_device_remove (plugin, device);
|
||||||
|
g_clear_object (&device);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -307,7 +311,7 @@ fu_plugin_dell_dock_func (void)
|
|||||||
fu_plugin_dell_device_added_cb (NULL, NULL,
|
fu_plugin_dell_device_added_cb (NULL, NULL,
|
||||||
plugin);
|
plugin);
|
||||||
g_assert (device != NULL);
|
g_assert (device != NULL);
|
||||||
device = NULL;
|
g_clear_object (&device);
|
||||||
g_free (buf.record);
|
g_free (buf.record);
|
||||||
fu_plugin_dell_device_removed_cb (NULL, NULL,
|
fu_plugin_dell_device_removed_cb (NULL, NULL,
|
||||||
plugin);
|
plugin);
|
||||||
@ -344,7 +348,7 @@ fu_plugin_dell_dock_func (void)
|
|||||||
fu_plugin_dell_device_added_cb (NULL, NULL,
|
fu_plugin_dell_device_added_cb (NULL, NULL,
|
||||||
plugin);
|
plugin);
|
||||||
g_assert (device != NULL);
|
g_assert (device != NULL);
|
||||||
device = NULL;
|
g_clear_object (&device);
|
||||||
g_free (buf.record);
|
g_free (buf.record);
|
||||||
fu_plugin_dell_device_removed_cb (NULL, NULL,
|
fu_plugin_dell_device_removed_cb (NULL, NULL,
|
||||||
plugin);
|
plugin);
|
||||||
@ -379,7 +383,7 @@ fu_plugin_dell_dock_func (void)
|
|||||||
fu_plugin_dell_device_added_cb (NULL, NULL,
|
fu_plugin_dell_device_added_cb (NULL, NULL,
|
||||||
plugin);
|
plugin);
|
||||||
g_assert (device != NULL);
|
g_assert (device != NULL);
|
||||||
device = NULL;
|
g_clear_object (&device);
|
||||||
g_free (buf.record);
|
g_free (buf.record);
|
||||||
fu_plugin_dell_device_removed_cb (NULL, NULL,
|
fu_plugin_dell_device_removed_cb (NULL, NULL,
|
||||||
plugin);
|
plugin);
|
||||||
@ -414,7 +418,7 @@ fu_plugin_dell_dock_func (void)
|
|||||||
fu_plugin_dell_device_added_cb (NULL, NULL,
|
fu_plugin_dell_device_added_cb (NULL, NULL,
|
||||||
plugin);
|
plugin);
|
||||||
g_assert (device != NULL);
|
g_assert (device != NULL);
|
||||||
device = NULL;
|
g_clear_object (&device);
|
||||||
g_free (buf.record);
|
g_free (buf.record);
|
||||||
fu_plugin_dell_device_removed_cb (NULL, NULL,
|
fu_plugin_dell_device_removed_cb (NULL, NULL,
|
||||||
plugin);
|
plugin);
|
||||||
|
Loading…
Reference in New Issue
Block a user