You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2009/12/03 00:31:06 UTC

svn commit: r886341 - /lucene/lucy/trunk/core/Lucy/Store/Folder.c

Author: marvin
Date: Wed Dec  2 23:31:06 2009
New Revision: 886341

URL: http://svn.apache.org/viewvc?rev=886341&view=rev
Log:
Fix bogus creation of a CompoundFileReader within Folder_Consolidate() when an
empty string "path" is passed, indicating that the Folder should consolidate
itself rather than a subfolder.  This fixes a memory leak in
TestCompoundFileReader.

Modified:
    lucene/lucy/trunk/core/Lucy/Store/Folder.c

Modified: lucene/lucy/trunk/core/Lucy/Store/Folder.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Store/Folder.c?rev=886341&r1=886340&r2=886341&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Store/Folder.c (original)
+++ lucene/lucy/trunk/core/Lucy/Store/Folder.c Wed Dec  2 23:31:06 2009
@@ -384,7 +384,7 @@
         CompoundFileWriter *cf_writer = CFWriter_new(folder);
         CFWriter_Consolidate(cf_writer);
         DECREF(cf_writer);
-        {
+        if (CB_Get_Size(path)) {
             ZombieCharBuf name_zcb = ZCB_BLANK;
             ZombieCharBuf *name = IxFileNames_local_part(path, &name_zcb);
             CompoundFileReader *cf_reader = CFReader_open(folder);