git: 9front

Download patch

ref: 2712dfb0330f163ad7757614e72a17b14fd21ec5
parent: efd6b8810e1c0a39f369250267a1aae9f19f80b1
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Wed Jul 9 19:55:54 EDT 2014

abaco: fix double free race of p->status string (thanks BurnZeZ for the proc snap)

--- a/sys/src/cmd/abaco/util.c
+++ b/sys/src/cmd/abaco/util.c
@@ -962,12 +962,12 @@
 	if(s == nil)
 		error("runevsmprint failed");
 
+	qlock(&refreshlock);
 	if(p->status){
 		free(p->status);
 		p->status = nil;
 	}
 	p->status = s;
-	qlock(&refreshlock);
 	for(r=refreshs; r!=nil; r=r->next)
 		if(r->p == p)
 			goto Return;
--