freefont() can suicide if you have not called initdraw() - not unresaonable you may think, but some programs, notably mc(1) want to know the size of their window but have no interest in drawing anything. mc(1) doen't bother calling freefont(), it just exits but my application is long lived and so mus not leak, hence this patch. -Steve Reference: /n/sources/patch/applied/freefont-buglet Date: Mon Jul 25 18:34:04 CES 2011 Signed-off-by: steve@quintile.net --- /sys/src/libdraw/buildfont.c Mon Jul 25 18:28:27 2011 +++ /sys/src/libdraw/buildfont.c Mon Jul 25 18:28:24 2011 @@ -129,7 +129,7 @@ } for(i=0; insubf; i++){ s = f->subf[i].f; - if(s && s!=display->defaultsubfont) + if(s && display && s!=display->defaultsubfont) freesubfont(s); } freeimage(f->cacheimage);