xfixes: avoid double free if AddResource fails
pChc is already freed through CursorFreeHideCount → deleteCursorHideCount. Reviewed-by: Rémi Cardona <remi@gentoo.org> Signed-off-by: Julien Cristau <jcristau@debian.org>
This commit is contained in:
parent
4217db89ec
commit
2be527b1d4
|
@ -774,10 +774,8 @@ createCursorHideCount(ClientPtr pClient, ScreenPtr pScreen)
|
|||
* Create a resource for this element so it can be deleted
|
||||
* when the client goes away.
|
||||
*/
|
||||
if (!AddResource(pChc->resource, CursorHideCountType, (void *) pChc)) {
|
||||
free(pChc);
|
||||
if (!AddResource(pChc->resource, CursorHideCountType, (void *) pChc))
|
||||
return BadAlloc;
|
||||
}
|
||||
|
||||
return Success;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue