lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r902828 - /lucene/lucy/trunk/core/Lucy/Object/VTable.c
Date Mon, 25 Jan 2010 14:42:22 GMT
Author: marvin
Date: Mon Jan 25 14:42:22 2010
New Revision: 902828

URL: http://svn.apache.org/viewvc?rev=902828&view=rev
Log:
Fix a memory leak in VTable.c.

Modified:
    lucene/lucy/trunk/core/Lucy/Object/VTable.c

Modified: lucene/lucy/trunk/core/Lucy/Object/VTable.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Object/VTable.c?rev=902828&r1=902827&r2=902828&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Object/VTable.c (original)
+++ lucene/lucy/trunk/core/Lucy/Object/VTable.c Mon Jan 25 14:42:22 2010
@@ -121,6 +121,7 @@
             }
             else {
                 parent = VTable_singleton(parent_class, NULL);
+                DECREF(parent_class);
             }
         }
 
@@ -224,13 +225,10 @@
     }
     else {
         CharBuf *klass = CB_Clone(vtable->name);
-        if (LFReg_Register(VTable_registry, (Obj*)klass, (Obj*)vtable)) {
-            return true;
-        }
-        else {
-            DECREF(klass);
-            return false;
-        }
+        bool_t retval 
+            = LFReg_Register(VTable_registry, (Obj*)klass, (Obj*)vtable);
+        DECREF(klass);
+        return retval;
     }
 }
 



Mime
View raw message