Fixes to memory deallocation suggested by Phil Longstaff.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13472 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Joshua Sled
2006-03-04 15:50:20 +00:00
parent 9a65cc1cc6
commit 7fb61dae86
2 changed files with 17 additions and 1 deletions

View File

@@ -1,3 +1,9 @@
2006-03-04 Joshua Sled <jsled@asynchronous.org>
* src/gnome-utils/gnc-menu-extensions.c (gnc_extension_path):
Fixes to memory deallocation suggested by Phil Longstaff
<plongstaff@newearth.org>.
2006-03-04 David Hampton <hampton@employees.org>
* src/gnome-utils/dialog-preferences.c:

View File

@@ -127,6 +127,7 @@ gnc_extension_path (SCM extension, char **fullpath)
SCM path;
gchar **strings;
gint i;
gint num_strings;
initialize_getters();
@@ -136,7 +137,8 @@ gnc_extension_path (SCM extension, char **fullpath)
return;
}
strings = g_new0(gchar *, scm_ilength(path) + 2);
num_strings = scm_ilength(path) + 2;
strings = g_new0(gchar *, num_strings);
strings[0] = "/menubar";
i = 1;
@@ -169,6 +171,14 @@ gnc_extension_path (SCM extension, char **fullpath)
*fullpath = g_strjoinv("/", strings);
for (i = 1; i < num_strings; i++)
{
if (strings[i] != NULL)
{
g_free(strings[i]);
}
}
g_free(strings);
}