diff options
author | Rami Ylimaki <ext-rami.ylimaki@nokia.com> | 2009-11-04 15:59:30 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-11-06 14:27:02 +1000 |
commit | 269202982d4a3ab8bb31caa0fd72088d61eba66c (patch) | |
tree | 01ec5feb91acb8e24ba52286e1bbe0caa39d81e9 /dix | |
parent | ade4636c7e9cb8f9a0b03168f47d5383af9cbdaf (diff) |
dix: Fixes a memory leak when a cursor resource is released.
Just open and close a client that creates cursors in order to
reproduce. In the problem case bits->refcnt is -1 and therefore
bits->devPrivates is never released.
Signed-off-by: Rami Ylimaki <ext-rami.ylimaki@nokia.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 0573042cddb6f9942e408687a16c6842e62a8bfa)
Diffstat (limited to 'dix')
-rw-r--r-- | dix/cursor.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/dix/cursor.c b/dix/cursor.c index 086d008e0..6103b15e3 100644 --- a/dix/cursor.c +++ b/dix/cursor.c @@ -86,6 +86,8 @@ FreeCursorBits(CursorBitsPtr bits) #ifdef ARGB_CURSOR xfree(bits->argb); #endif + dixFreePrivates(bits->devPrivates); + bits->devPrivates = NULL; if (bits->refcnt == 0) { GlyphSharePtr *prev, this; @@ -100,7 +102,6 @@ FreeCursorBits(CursorBitsPtr bits) CloseFont(this->font, (Font)0); xfree(this); } - dixFreePrivates(bits->devPrivates); xfree(bits); } } |