From 76c5a174fef9a2f3a46c7476a21bd202e521c36b Mon Sep 17 00:00:00 2001 From: Christian Persch Date: Thu, 29 Jan 2004 11:42:33 +0000 Subject: Fix mem leak. 2004-01-29 Christian Persch * embed/downloader-view.c: (update_download_row): Fix mem leak. --- ChangeLog | 6 ++++++ embed/downloader-view.c | 13 ++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5bb83ee3..3f7a15b55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-01-29 Christian Persch + + * embed/downloader-view.c: (update_download_row): + + Fix mem leak. + 2004-01-29 Christian Persch * embed/mozilla/EphyHeaderSniffer.cpp: diff --git a/embed/downloader-view.c b/embed/downloader-view.c index 1a04f97a4..96e27bb2c 100644 --- a/embed/downloader-view.c +++ b/embed/downloader-view.c @@ -249,7 +249,7 @@ update_download_row (DownloaderView *dv, EphyDownload *download) GtkTreeIter iter; EphyDownloadState state; long total, current, remaining_secs; - char *remaining, *file, *cur_progress; + char *remaining, *file, *cur_progress, *name; struct tm; int percent; @@ -283,22 +283,20 @@ update_download_row (DownloaderView *dv, EphyDownload *download) cur_progress = gnome_vfs_format_file_size_for_display (current); + name = ephy_download_get_name (download); + if (total != -1) { - char *total_progress, *name; + char *total_progress; - name = ephy_download_get_name (download); total_progress = gnome_vfs_format_file_size_for_display (total); file = g_strdup_printf ("%s\n%s of %s", name, cur_progress, total_progress); - g_free (name); g_free (total_progress); } else { - file = g_strdup_printf ("%s\n%s", - ephy_download_get_name (download), - cur_progress); + file = g_strdup_printf ("%s\n%s", name, cur_progress); } if (remaining_secs < 0) @@ -320,6 +318,7 @@ update_download_row (DownloaderView *dv, EphyDownload *download) -1); gtk_tree_path_free (path); + g_free (name); g_free (cur_progress); g_free (file); g_free (remaining); -- cgit v1.2.3