[Gnucash-changes] fix null-pointer deref/memory leak

Linas Vepstas linas at cvs.gnucash.org
Fri Aug 27 14:49:45 EDT 2004


Log Message:
-----------
fix null-pointer deref/memory leak

Modified Files:
--------------
    gnucash/src/engine:
        gnc-commodity.c

Revision Data
-------------
Index: gnc-commodity.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/engine/gnc-commodity.c,v
retrieving revision 1.69
retrieving revision 1.70
diff -Lsrc/engine/gnc-commodity.c -Lsrc/engine/gnc-commodity.c -u -r1.69 -r1.70
--- src/engine/gnc-commodity.c
+++ src/engine/gnc-commodity.c
@@ -1357,11 +1357,9 @@
 {
   gnc_commodity_namespace * ns = NULL; 
   
-  if(table) 
-  { 
-    ns = g_hash_table_lookup(table->table, (gpointer)namespace);
-  }
+  if (!table) return;
   
+  ns = g_hash_table_lookup(table->table, (gpointer)namespace);
   if(!ns) 
   {
     GCache *str_cache = gnc_engine_get_string_cache ();


More information about the gnucash-changes mailing list