From 9954541fdc25579033d396554717b4e4c30c8cfb Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Thu, 14 Jun 2012 19:35:58 +0200 Subject: Fix memory leak --- src/window-commands.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/window-commands.c b/src/window-commands.c index 535745741..98364d712 100644 --- a/src/window-commands.c +++ b/src/window-commands.c @@ -370,14 +370,15 @@ download_status_changed_cb (WebKitDownload *download, EphyApplicationDialogData *data) { WebKitDownloadStatus status = webkit_download_get_status (download); - const char *destination; + char *filename; switch (status) { case WEBKIT_DOWNLOAD_STATUS_FINISHED: - destination = g_filename_from_uri (webkit_download_get_destination_uri (download), + filename = g_filename_from_uri (webkit_download_get_destination_uri (download), NULL, NULL); - gtk_image_set_from_file (GTK_IMAGE (data->image), destination); + gtk_image_set_from_file (GTK_IMAGE (data->image), filename); + g_free (filename); break; case WEBKIT_DOWNLOAD_STATUS_ERROR: case WEBKIT_DOWNLOAD_STATUS_CANCELLED: -- cgit v1.2.3