r22698 - gnucash/trunk/src/gnome-utils - Fix string leak in gnc_gnome_help()

John Ralls jralls at code.gnucash.org
Sun Jan 13 17:51:44 EST 2013


Author: jralls
Date: 2013-01-13 17:51:44 -0500 (Sun, 13 Jan 2013)
New Revision: 22698
Trac: http://svn.gnucash.org/trac/changeset/22698

Modified:
   gnucash/trunk/src/gnome-utils/gnc-gnome-utils.c
Log:
Fix string leak in gnc_gnome_help()

Thanks to Yawar Amin for pointing it out.

Modified: gnucash/trunk/src/gnome-utils/gnc-gnome-utils.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-gnome-utils.c	2013-01-11 17:21:32 UTC (rev 22697)
+++ gnucash/trunk/src/gnome-utils/gnc-gnome-utils.c	2013-01-13 22:51:44 UTC (rev 22698)
@@ -411,6 +411,7 @@
 {
     GError *error = NULL;
     gchar *uri = NULL;
+    gboolean success;
 
     if (anchor)
         uri = g_strconcat ("ghelp:", file_name, "?", anchor, NULL);
@@ -418,8 +419,9 @@
         uri = g_strconcat ("ghelp:", file_name, NULL);
 
     DEBUG ("Attempting to opening help uri %s", uri);
-
-    if (gtk_show_uri (NULL, uri, gtk_get_current_event_time (), &error))
+    success = gtk_show_uri (NULL, uri, gtk_get_current_event_time (), &error);
+    g_free (uri);
+    if (success)
         return;
 
     g_assert(error != NULL);



More information about the gnucash-changes mailing list