Commit Diff


commit - cd717821944a6c823fea3a3c7764fa364a37e9ec
commit + cc538cdd88f6de14b46ea3b317c6042b4fa72763
blob - 499cfb5cf31ce4b89b028472a453d69fcbafcb54
blob + eb92f1cb845b67bd2049d7ca985579894a9c3220
--- lib/object.c
+++ lib/object.c
@@ -423,7 +423,8 @@ got_object_close(struct got_object *obj)
 {
 	if (obj->refcnt > 0) {
 		obj->refcnt--;
-		return;
+		if (obj->refcnt > 0)
+			return;
 	}
 
 	if (obj->flags & GOT_OBJ_FLAG_DELTIFIED) {
@@ -1013,7 +1014,8 @@ got_object_commit_close(struct got_commit_object *comm
 
 	if (commit->refcnt > 0) {
 		commit->refcnt--;
-		return;
+		if (commit->refcnt > 0)
+			return;
 	}
 
 	while (!SIMPLEQ_EMPTY(&commit->parent_ids)) {
@@ -1203,7 +1205,8 @@ got_object_tree_close(struct got_tree_object *tree)
 
 	if (tree->refcnt > 0) {
 		tree->refcnt--;
-		return;
+		if (tree->refcnt > 0)
+			return;
 	}
 
 	while (!SIMPLEQ_EMPTY(&tree->entries)) {