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>
(cherry picked from commit 2be527b1d4
)
This commit is contained in:
parent
b7e1f25005
commit
7680f558e1
|
@ -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