git: 9front

Download patch

ref: bb57346c3c3300542eeb425589d73e121e9d9839
parent: 6ed83a572c0d53f4e3f93bceb7ba56b8341543c3
author: Ori Bernstein <ori@eigenstate.org>
date: Sun Nov 23 10:58:57 EST 2025

gefs: fix ref leak when setb clears a block

--- a/sys/src/cmd/gefs/tree.c
+++ b/sys/src/cmd/gefs/tree.c
@@ -444,10 +444,13 @@
 static void
 setb(Blk **dst, Tree *t, Blk *b)
 {
-	if(*dst != nil)
+	if(*dst != nil){
 		freeblk(t, *dst);
+		dropblk(*dst);
+	}
 	if(b->nval == 0){
 		freeblk(t, b);
+		dropblk(b);
 		*dst = nil;
 	}else{
 		enqueue(b);
--