devdraw: call freememimage consistently

Without this, it's possible for a Memimage* from a custom allocmemimage
to get passed to libdraw's implementation of freememimage.

Signed-off-by: Hank Donnay <hdonnay@gmail.com>
This commit is contained in:
Hank Donnay 2022-04-20 14:32:42 -05:00
parent bab7b73b85
commit c44015fd9a

View file

@ -54,7 +54,7 @@ gfx_replacescreenimage(Client *c, Memimage *m)
c->screenimage = m;
m->screenref = 1;
if(om && --om->screenref == 0){
_freememimage(om);
freememimage(om);
}
qunlock(&drawlk);
gfx_mouseresized(c);
@ -452,7 +452,7 @@ drawfreedimage(Client *client, DImage *dimage)
if(l->screenref==0)
freememimage(l);
else if(--l->screenref==0)
_freememimage(l);
freememimage(l);
}
Return:
free(dimage->fchar);