diff options
author | Julien Cristau <jcristau@debian.org> | 2016-03-02 21:28:20 +0100 |
---|---|---|
committer | Julien Cristau <jcristau@debian.org> | 2016-03-02 21:30:17 +0100 |
commit | 4546cbf1cec10891319c7049db15e64c3d1c0169 (patch) | |
tree | 3e69edf3817fa010a27d2e939ff0aec0fb1b195a | |
parent | 3c01d42e7def429bc8526b24a16323d2db34117b (diff) |
xfixes: avoid double free if AddResource failsaddresources
pChc is already freed through CursorFreeHideCount →
deleteCursorHideCount.
Signed-off-by: Julien Cristau <jcristau@debian.org>
-rw-r--r-- | xfixes/cursor.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/xfixes/cursor.c b/xfixes/cursor.c index 5619aad2e..10f9b2346 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -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; } |