Skip to content

Commit

Permalink
devdraw: call freememimage consistently
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
hdonnay committed Apr 20, 2022
1 parent bab7b73 commit c44015f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/cmd/devdraw/devdraw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c44015f

Please sign in to comment.