fix memory leak

This commit is contained in:
Yuvia 2025-08-12 13:05:50 +00:00
parent a515c92369
commit 7982b261b9

2
data.c
View file

@ -195,10 +195,10 @@ iconinit(void)
sysfatal("please set your home: %r");
buf = smprint("%s/lib/riobg.bit", h);
fd = open(buf, OREAD);
free(buf);
if(fd<0)
background = allocimage(display, Rect(0,0,1,1), CMAP8, 1, 0x777777FF);
else{
free(buf);
background = readimage(display, fd, 0);
close(fd);
}