changeset 15964:8a54f74fecdf

plug some leaks
author Richard Nelson <wabz@pidgin.im>
date Thu, 29 Mar 2007 02:35:54 +0000
parents 26a5869b3165
children e0cfde70d839
files finch/gntft.c finch/libgnt/gntfilesel.c finch/libgnt/gntstyle.c finch/libgnt/gntwm.c
diffstat 4 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/finch/gntft.c	Thu Mar 29 01:27:40 2007 +0000
+++ b/finch/gntft.c	Thu Mar 29 02:35:54 2007 +0000
@@ -392,8 +392,6 @@
 	elapsed = (xfer->start_time > 0 ? now - xfer->start_time : 0);
 	kbps    = (elapsed > 0 ? (kb_sent / elapsed) : 0);
 
-	kbsec = g_strdup_printf(_("%.2f KB/s"), kbps);
-
 	g_return_if_fail(xfer_dialog != NULL);
 	g_return_if_fail(xfer != NULL);
 
@@ -413,6 +411,7 @@
 
 	size_str      = purple_str_size_to_units(purple_xfer_get_size(xfer));
 	remaining_str = purple_str_size_to_units(purple_xfer_get_bytes_remaining(xfer));
+	kbsec = g_strdup_printf(_("%.2f KB/s"), kbps);
 
 	gnt_tree_change_text(GNT_TREE(xfer_dialog->tree), xfer, COLUMN_PROGRESS,
 			g_ascii_dtostr(prog_str, sizeof(prog_str), purple_xfer_get_progress(xfer) * 100.));
@@ -421,6 +420,7 @@
 	gnt_tree_change_text(GNT_TREE(xfer_dialog->tree), xfer, COLUMN_SPEED, kbsec);
 	g_free(size_str);
 	g_free(remaining_str);
+	g_free(kbsec);
 	if (purple_xfer_is_completed(xfer)) {
 		gnt_tree_change_text(GNT_TREE(xfer_dialog->tree), xfer, COLUMN_STATUS, _("Finished"));
 		gnt_tree_change_text(GNT_TREE(xfer_dialog->tree), xfer, COLUMN_REMAINING, _("Finished"));
--- a/finch/libgnt/gntfilesel.c	Thu Mar 29 01:27:40 2007 +0000
+++ b/finch/libgnt/gntfilesel.c	Thu Mar 29 02:35:54 2007 +0000
@@ -464,7 +464,7 @@
 {
 	char *ret;
 	if (sel->dirsonly) {
-		ret = g_strdup(g_path_get_dirname(gnt_entry_get_text(GNT_ENTRY(sel->location))));
+		ret = g_path_get_dirname(gnt_entry_get_text(GNT_ENTRY(sel->location)));
 	} else {
 		ret = g_strdup(gnt_entry_get_text(GNT_ENTRY(sel->location)));
 	}
--- a/finch/libgnt/gntstyle.c	Thu Mar 29 01:27:40 2007 +0000
+++ b/finch/libgnt/gntstyle.c	Thu Mar 29 02:35:54 2007 +0000
@@ -218,9 +218,8 @@
 	{
 		for (i = 0; styles[i].style; i++)
 		{
-			error = NULL;
 			str_styles[styles[i].en] =
-					g_key_file_get_string(kfile, "general", styles[i].style, &error);
+					g_key_file_get_string(kfile, "general", styles[i].style, NULL);
 		}
 	}
 	g_strfreev(keys);
--- a/finch/libgnt/gntwm.c	Thu Mar 29 01:27:40 2007 +0000
+++ b/finch/libgnt/gntwm.c	Thu Mar 29 02:35:54 2007 +0000
@@ -246,6 +246,7 @@
 	}
 
 	g_free(filename);
+	g_key_file_free(gfile);
 #endif
 }