summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2013-06-13 14:18:52 +0200
committerDavid King <amigadave@amigadave.com>2013-09-02 22:14:49 +0100
commitd55e6732315744725b5afa2b90c8c693ec93d5ee (patch)
tree61f05fb0f1ba7210ad4cab8ad2439c31b9181462
parent228eea8a6bbaac21f04579b93510356c85782e49 (diff)
Fix memory leak when freeing video formats
Free the GList, as well as the video formats in the list. Signed-off-by: Hans de Goede <hdegoede@redhat.com>
-rw-r--r--libcheese/cheese-camera-device.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libcheese/cheese-camera-device.c b/libcheese/cheese-camera-device.c
index 0ac5b59..580ec4b 100644
--- a/libcheese/cheese-camera-device.c
+++ b/libcheese/cheese-camera-device.c
@@ -384,12 +384,11 @@ cheese_camera_device_add_format (CheeseCameraDevice *device,
/*
* free_format_list_foreach:
* @data: the #CheeseVideoFormatFull to free
- * @user_data: unused
*
* Free the individual #CheeseVideoFormatFull.
*/
static void
-free_format_list_foreach (gpointer data, G_GNUC_UNUSED gpointer user_data)
+free_format_list_foreach (gpointer data)
{
g_slice_free (CheeseVideoFormatFull, data);
}
@@ -405,7 +404,7 @@ free_format_list (CheeseCameraDevice *device)
{
CheeseCameraDevicePrivate *priv = device->priv;
- g_list_foreach (priv->formats, free_format_list_foreach, NULL);
+ g_list_free_full (priv->formats, free_format_list_foreach);
priv->formats = NULL;
}