shithub: riscv

Download patch

ref: f164ee6dd9be3f59ae60a6436766cec39892e3c6
parent: 51319cc5b56924b03d9c6188f6a1e189a497d42c
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);
 }
 
 /*