Hello!
I have another fix for a memory leak. Here is the code:
static void process_build_output_line(const gchar *str, gint color) { gchar *msg, *tmp; gchar *filename; gint line;
msg = g_strdup(str);
g_strchomp(msg);
if (! NZV(msg)) return; .....
The patch:
Index: src/build.c =================================================================== --- src/build.c (revision 5207) +++ src/build.c (arbetskopia) @@ -996,7 +996,10 @@ g_strchomp(msg);
if (! NZV(msg)) + { + g_free(msg); return; + }
if (build_parse_make_dir(msg, &tmp)) {
Best regards, Daniel
Hi,
On Wed, 8 Sep 2010 21:02:34 +0200 Daniel Marjamäki daniel.marjamaki@gmail.com wrote:
I have another fix for a memory leak. Here is the code:
static void process_build_output_line(const gchar *str, gint color) { gchar *msg, *tmp; gchar *filename; gint line;
msg = g_strdup(str);
g_strchomp(msg);
if (! NZV(msg)) return; .....
The patch:
Index: src/build.c
--- src/build.c (revision 5207) +++ src/build.c (arbetskopia) @@ -996,7 +996,10 @@ g_strchomp(msg);
if (! NZV(msg))
{
g_free(msg);
return;
}
if (build_parse_make_dir(msg, &tmp)) {
Thanks for the finding. I've committed to svn, but added a NULL-check just to be sure.
Thanks, Frank
Frank Lanitz wrote:
Thanks for the finding. I've committed to svn, but added a NULL-check just to be sure.
The NULL check is un-necessary:
http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-f...
Erik
On Thu, 9 Sep 2010 10:59:37 +1000 Erik de Castro Lopo mle+tools@mega-nerd.com wrote:
Frank Lanitz wrote:
Thanks for the finding. I've committed to svn, but added a NULL-check just to be sure.
The NULL check is un-necessary:
http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-free
Well, ok. I had some bad experience in past with freeing memory so I started doing this. But based on documentation you are right and I did remove these check.
Thanks, Frank