r21231 - gnucash/trunk/src/gnome-utils - (cppcheck) Fix a possible memory leak: data

Christian Stimming cstim at code.gnucash.org
Thu Sep 1 02:50:56 EDT 2011


Author: cstim
Date: 2011-09-01 02:50:56 -0400 (Thu, 01 Sep 2011)
New Revision: 21231
Trac: http://svn.gnucash.org/trac/changeset/21231

Modified:
   gnucash/trunk/src/gnome-utils/gnc-main-window.c
Log:
(cppcheck) Fix a possible memory leak: data

Modified: gnucash/trunk/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/trunk/src/gnome-utils/gnc-main-window.c	2011-09-01 06:50:45 UTC (rev 21230)
+++ gnucash/trunk/src/gnome-utils/gnc-main-window.c	2011-09-01 06:50:56 UTC (rev 21231)
@@ -2821,14 +2821,14 @@
     g_return_if_fail (n_actions > 0);
     g_return_if_fail (filename != NULL);
 
+    pathname = gnc_gnome_locate_ui_file (filename);
+    if (pathname == NULL)
+        return;
+
     data = g_new0 (GncMainWindowActionData, 1);
     data->window = window;
     data->data = user_data;
 
-    pathname = gnc_gnome_locate_ui_file (filename);
-    if (pathname == NULL)
-        return;
-
     priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
     entry = g_new0 (MergedActionEntry, 1);
     entry->action_group = gtk_action_group_new (group_name);



More information about the gnucash-changes mailing list