r16630 - gnucash/branches/2.2/src/app-utils - [merge r16629] dupilcate hash-table-owned key to prevent memory corruption

Josh Sled jsled at cvs.gnucash.org
Sun Dec 9 19:08:08 EST 2007


Author: jsled
Date: 2007-12-09 19:08:08 -0500 (Sun, 09 Dec 2007)
New Revision: 16630
Trac: http://svn.gnucash.org/trac/changeset/16630

Modified:
   gnucash/branches/2.2/src/app-utils/gnc-sx-instance-model.c
Log:
[merge r16629] dupilcate hash-table-owned key to prevent memory corruption


Modified: gnucash/branches/2.2/src/app-utils/gnc-sx-instance-model.c
===================================================================
--- gnucash/branches/2.2/src/app-utils/gnc-sx-instance-model.c	2007-12-09 23:29:16 UTC (rev 16629)
+++ gnucash/branches/2.2/src/app-utils/gnc-sx-instance-model.c	2007-12-10 00:08:08 UTC (rev 16630)
@@ -846,7 +846,7 @@
 
                     g_assert(parent_var != NULL);
                     var_copy = gnc_sx_variable_new_copy(parent_var);
-                    g_hash_table_insert(inst->variable_bindings, to_add_key, var_copy);
+                    g_hash_table_insert(inst->variable_bindings, g_strdup(to_add_key), var_copy);
                 }
             }
         }



More information about the gnucash-changes mailing list