Fixes and debugging assertions.
[bluesky.git] / bluesky / cleaner.c
index ec2b5dd..d7e29eb 100644 (file)
@@ -142,8 +142,11 @@ static BlueSkyCleanerItem *bluesky_cleaner_find_checkpoint(BlueSkyFS *fs)
         length = item->length;
     }
 
-    if (length == 0)
+    if (length == 0) {
+        bluesky_cachefile_unref(cachefile);
+        g_mutex_unlock(cachefile->lock);
         return NULL;
+    }
 
     g_print("Found a cleaner checkpoint record.\n");