mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-05-09 04:58:06 +02:00
xfree86: dri2: fix memory leak and free resources properly
Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Reviewed-by: Nicolas Peninguy <nico@lostgeeks.org> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
66c86ca867
commit
518109e200
1 changed files with 7 additions and 2 deletions
|
|
@ -221,11 +221,16 @@ DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID dri2_id,
|
||||||
if (ref == NULL)
|
if (ref == NULL)
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
|
||||||
if (!AddResource(dri2_id, dri2DrawableRes, pPriv))
|
if (!AddResource(dri2_id, dri2DrawableRes, pPriv)) {
|
||||||
|
free(ref);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
}
|
||||||
if (!DRI2LookupDrawableRef(pPriv, id))
|
if (!DRI2LookupDrawableRef(pPriv, id))
|
||||||
if (!AddResource(id, dri2DrawableRes, pPriv))
|
if (!AddResource(id, dri2DrawableRes, pPriv)) {
|
||||||
|
FreeResourceByType(dri2_id, dri2DrawableRes, TRUE);
|
||||||
|
free(ref);
|
||||||
return BadAlloc;
|
return BadAlloc;
|
||||||
|
}
|
||||||
|
|
||||||
ref->id = id;
|
ref->id = id;
|
||||||
ref->dri2_id = dri2_id;
|
ref->dri2_id = dri2_id;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue