[epiphany] Fix memory leak



commit 9954541fdc25579033d396554717b4e4c30c8cfb
Author: Carlos Garcia Campos <cgarcia igalia com>
Date:   Thu Jun 14 19:35:58 2012 +0200

    Fix memory leak

 src/window-commands.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/src/window-commands.c b/src/window-commands.c
index 5357457..98364d7 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:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]