diff options
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | gtk/gtkprintjob.c | 1 | ||||
-rw-r--r-- | modules/printbackends/file/gtkprintbackendfile.c | 4 | ||||
-rw-r--r-- | modules/printbackends/test/gtkprintbackendtest.c | 4 |
4 files changed, 18 insertions, 2 deletions
@@ -1,3 +1,14 @@ +2008-08-29 Christian Dywan <christian@imendio.com> + + Bug 549810 – Memory leaks in printing code + + * gtk/gtkprintjob.c (gtk_print_job_set_property): + * modules/printbackends/file/gtkprintbackendfile.c + (output_file_from_settings): + * modules/printbackends/test/gtkprintbackendtest.c + (output_test_from_settings): free some temporary strings. + Patch by Yevgen Muntyan. + 2008-08-29 Michael Natterer <mitch@imendio.com> * gtk/gtkwidget.h: move the gtk_widget_get_parent() and diff --git a/gtk/gtkprintjob.c b/gtk/gtkprintjob.c index d9ff9cdc55..c59a27a741 100644 --- a/gtk/gtkprintjob.c +++ b/gtk/gtkprintjob.c @@ -585,6 +585,7 @@ gtk_print_job_set_property (GObject *object, switch (prop_id) { case PROP_TITLE: + g_free (priv->title); priv->title = g_value_dup_string (value); break; diff --git a/modules/printbackends/file/gtkprintbackendfile.c b/modules/printbackends/file/gtkprintbackendfile.c index 43b96f457c..070a69a9e4 100644 --- a/modules/printbackends/file/gtkprintbackendfile.c +++ b/modules/printbackends/file/gtkprintbackendfile.c @@ -238,11 +238,13 @@ output_file_from_settings (GtkPrintSettings *settings, if (locale_name != NULL) { - path = g_build_filename (g_get_current_dir (), locale_name, NULL); + gchar *current_dir = g_get_current_dir (); + path = g_build_filename (current_dir, locale_name, NULL); g_free (locale_name); uri = g_filename_to_uri (path, NULL, NULL); g_free (path); + g_free (current_dir); } } diff --git a/modules/printbackends/test/gtkprintbackendtest.c b/modules/printbackends/test/gtkprintbackendtest.c index 73ce61b7bd..c8ff0021d8 100644 --- a/modules/printbackends/test/gtkprintbackendtest.c +++ b/modules/printbackends/test/gtkprintbackendtest.c @@ -238,11 +238,13 @@ output_test_from_settings (GtkPrintSettings *settings, if (locale_name != NULL) { - path = g_build_filename (g_get_current_dir (), locale_name, NULL); + gchar *current_dir = g_get_current_dir (); + path = g_build_filename (current_dir, locale_name, NULL); g_free (locale_name); uri = g_filename_to_uri (path, NULL, NULL); g_free (path); + g_free (current_dir); } } |