shithub: riscv

Download patch

ref: fa06413db46b6f9fce9d01f5d3283e33849ca579
parent: f188158f1cd94842b6b0c355a359b2e4d4c4b0e4
author: mischief <[email protected]>
date: Sun Dec 28 18:11:21 EST 2014

libdraw: don't deference nil display in freefont

--- a/sys/src/libdraw/buildfont.c
+++ b/sys/src/libdraw/buildfont.c
@@ -129,8 +129,9 @@
 	}
 	for(i=0; i<f->nsubf; i++){
 		s = f->subf[i].f;
-		if(s && s!=display->defaultsubfont)
-			freesubfont(s);
+		if(s)
+			if(display == nil || s!=display->defaultsubfont)
+				freesubfont(s);
 	}
 	freeimage(f->cacheimage);
 	free(f->name);