r20718 - gnucash/trunk/src/engine - Correct memory leak found with Valgrind.

J. Alex Aycinena alex.aycinena at code.gnucash.org
Sat May 28 19:32:33 EDT 2011


Author: alex.aycinena
Date: 2011-05-28 19:32:33 -0400 (Sat, 28 May 2011)
New Revision: 20718
Trac: http://svn.gnucash.org/trac/changeset/20718

Modified:
   gnucash/trunk/src/engine/engine-helpers.c
Log:
Correct memory leak found with Valgrind.

Modified: gnucash/trunk/src/engine/engine-helpers.c
===================================================================
--- gnucash/trunk/src/engine/engine-helpers.c	2011-05-28 21:53:03 UTC (rev 20717)
+++ gnucash/trunk/src/engine/engine-helpers.c	2011-05-28 23:32:33 UTC (rev 20718)
@@ -140,15 +140,18 @@
 gnc_scm2guid(SCM guid_scm)
 {
     GncGUID guid;
-    const gchar * str;
+    gchar * str;
 
     if (!scm_is_string(guid_scm)
         || (GUID_ENCODING_LENGTH != scm_c_string_length (guid_scm)))
     {
         return *guid_null();
     }
+    scm_dynwind_begin (0); 
     str = scm_to_locale_string (guid_scm);
     string_to_guid(str, &guid);
+    scm_dynwind_free (str); 
+    scm_dynwind_end (); 
     return guid;
 }
 



More information about the gnucash-changes mailing list