git: 9front

Download patch

ref: a6e8c537f7005cadda33aebfeb4ca6bd3a31b9b7
parent: 3ed1e24460dbefcb247702aed6c7d4c98c2f2ca5
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Jan 23 11:38:32 EST 2021

upas/runq: fix typo

one slipped in to the last commit.

--- a/sys/src/cmd/upas/q/runq.c
+++ b/sys/src/cmd/upas/q/runq.c
@@ -151,12 +151,13 @@
 	long i, n;
 
 
-	if((fd = open(".", OREAD)) == -1)
+	if((fd = open(".", OREAD)) == -1){
 		warning("opening %s", root);
 		return;
 	}
 	if((n = dirreadall(fd, &db)) == -1){
 		warning("reading %s: ", root);
+		close(fd);
 		return;
 	}
 	for(i=0; i<n; i++){
@@ -166,8 +167,8 @@
 			continue;
 		dodir(db[i].name);
 	}
-	free(db);
 	close(fd);
+	free(db);
 }
 
 /*
--