[gtk+] Don't leak display name
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Don't leak display name
- Date: Fri, 3 Sep 2010 16:50:13 +0000 (UTC)
commit bf3b5f785e84f450c4c95ca0b2bd02acc88e652f
Author: Matthew Barnes <mbarnes redhat com>
Date: Fri Sep 3 12:48:50 2010 -0400
Don't leak display name
Bug 628656 - _gdk_windowing_get_startup_notify_id memory leak
get_display_name() returns a newly allocated string, which was being fed
directory info a g_strdup_printf() call.
gdk/x11/gdkapplaunchcontext-x11.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
---
diff --git a/gdk/x11/gdkapplaunchcontext-x11.c b/gdk/x11/gdkapplaunchcontext-x11.c
index 0d5b10e..b91b213 100644
--- a/gdk/x11/gdkapplaunchcontext-x11.c
+++ b/gdk/x11/gdkapplaunchcontext-x11.c
@@ -311,7 +311,11 @@ _gdk_windowing_get_startup_notify_id (GAppLaunchContext *context,
if (files_count == 0)
description = g_strdup_printf (_("Starting %s"), g_app_info_get_name (info));
else if (files_count == 1)
- description = g_strdup_printf (_("Opening %s"), get_display_name (files->data));
+ {
+ gchar *display_name = get_display_name (files->data);
+ description = g_strdup_printf (_("Opening %s"), display_name);
+ g_free (display_name);
+ }
else
description = g_strdup_printf (g_dngettext (GETTEXT_PACKAGE,
"Opening %d Item",
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]