summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorSean Fox <dyntryx@gmail.com>2009-01-29 08:13:28 +0000
committerSean Fox <dyntryx@gmail.com>2009-01-29 08:13:28 +0000
commitab3da706594ddc09352bd58c3deb88debd7eb613 (patch)
tree68aef2cc5a4765484ff3d3188e93506cd2381f4d /gtk
parent619e5b96318ed18693e8f9761643c87c9c033a84 (diff)
downloadnetsurf-ab3da706594ddc09352bd58c3deb88debd7eb613.tar.gz
netsurf-ab3da706594ddc09352bd58c3deb88debd7eb613.tar.bz2
Squash some memory leaks.
svn path=/trunk/netsurf/; revision=6290
Diffstat (limited to 'gtk')
-rw-r--r--gtk/dialogs/gtk_about.c5
-rw-r--r--gtk/gtk_download.c14
2 files changed, 13 insertions, 6 deletions
diff --git a/gtk/dialogs/gtk_about.c b/gtk/dialogs/gtk_about.c
index 36cce9d07..dbad4274d 100644
--- a/gtk/dialogs/gtk_about.c
+++ b/gtk/dialogs/gtk_about.c
@@ -66,9 +66,10 @@ void nsgtk_about_dialog_init(GtkWindow *parent, struct browser_window *bw,
const char *version)
{
gchar *licence_text;
+ gchar *licence_location = g_strconcat(res_dir_location, "licence", NULL);
- g_file_get_contents(g_strconcat(res_dir_location, "licence", NULL),
- &licence_text, NULL, NULL);
+ g_file_get_contents(licence_location, &licence_text, NULL, NULL);
+ free(licence_location);
gtk_about_dialog_set_url_hook (launch_url, (gpointer) bw, NULL);
gtk_show_about_dialog(parent, "artists", artists, "authors", authors,
diff --git a/gtk/gtk_download.c b/gtk/gtk_download.c
index 5c1076eb3..23b30ef88 100644
--- a/gtk/gtk_download.c
+++ b/gtk/gtk_download.c
@@ -215,7 +215,7 @@ struct gui_download_window *gui_download_window_create(const char *url,
strcpy(domain, messages_get("gtkUnknownHost"));
destination = nsgtk_download_dialog_show(filename, domain, size);
- if (destination == NULL)
+ if (destination == NULL)
return NULL;
/* Add the new row and store the reference to it (which keeps track of
@@ -236,12 +236,15 @@ struct gui_download_window *gui_download_window_create(const char *url,
download->time_remaining = -1;
download->status = NSGTK_DOWNLOAD_NONE;
download->filename = destination;
- download->progress = 0;
+ download->progress = 0;
download->error = NULL;
- download->write = g_io_channel_new_file(destination, "w",
+ download->write = g_io_channel_new_file(destination, "w",
&download->error);
if (nsgtk_download_handle_error(download->error)) {
- free(download);
+ g_string_free(download->name, TRUE);
+ g_string_free(download->time_left, TRUE);
+ g_free(download->filename);
+ free(download);
return NULL;
}
g_io_channel_set_encoding(download->write, NULL,
@@ -527,6 +530,9 @@ void nsgtk_download_store_clear_item (struct gui_download_window *dl)
gtk_tree_row_reference_get_path(dl->row));
gtk_list_store_remove(nsgtk_download_store,
&nsgtk_download_iter);
+ g_string_free(dl->name, TRUE);
+ g_string_free(dl->time_left, TRUE);
+ g_free(dl->filename);
g_free(dl);
nsgtk_download_sensitivity_evaluate(nsgtk_download_selection);