[haiku-commits] r40005 - haiku/trunk/src/apps/showimage

  • From: leavengood@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 29 Dec 2010 04:54:08 +0100 (CET)

Author: leavengood
Date: 2010-12-29 04:54:07 +0100 (Wed, 29 Dec 2010)
New Revision: 40005
Changeset: http://dev.haiku-os.org/changeset/40005

Modified:
   haiku/trunk/src/apps/showimage/ImageFileNavigator.cpp
Log:
CID 5772: Delete the unneeded (and leaked) ref on the loop end case.


Modified: haiku/trunk/src/apps/showimage/ImageFileNavigator.cpp
===================================================================
--- haiku/trunk/src/apps/showimage/ImageFileNavigator.cpp       2010-12-29 
03:47:21 UTC (rev 40004)
+++ haiku/trunk/src/apps/showimage/ImageFileNavigator.cpp       2010-12-29 
03:54:07 UTC (rev 40005)
@@ -300,8 +300,10 @@
        while (true) {
                entry_ref* ref = new entry_ref();
                status_t status = fFolder.GetNextRef(ref);
-               if (status != B_OK)
+               if (status != B_OK) {
+                       delete ref;
                        break;
+               }
 
                fEntries.AddItem(ref);
        }


Other related posts:

  • » [haiku-commits] r40005 - haiku/trunk/src/apps/showimage - leavengood