[PATCH] [xorg/xserver] mi/misprite: release private record

Daniel Stone daniel at fooishbar.org
Wed Mar 9 05:57:32 PST 2011


Hi,

On Wed, Mar 09, 2011 at 03:42:14PM +0200, Erkki Seppälä wrote:
> The record allocated by miSpriteDeviceCursorInitialize was not being
> released. This patch adds a call to free and resetting the private
> record to miSpriteDeviceCursorCleanup.
> 
> Reviewed-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
> Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
> ---
>  mi/misprite.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/mi/misprite.c b/mi/misprite.c
> index 770951e..0306f62 100644
> --- a/mi/misprite.c
> +++ b/mi/misprite.c
> @@ -892,6 +892,9 @@ miSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScreen)
>  {
>      if (DevHasCursor(pDev))
>          miDCDeviceCleanup(pDev, pScreen);
> +
> +    free(dixLookupPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey));
> +    dixSetPrivate(&pDev->devPrivates, miSpriteDevPrivatesKey, NULL);
>  }

You could get this automatically by having miSpriteDevPrivatesKey
allocate sizeof(miCursorInfoRec), rather than doing the allocation and
free separately.

Cheers,
Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20110309/dcc6c5ea/attachment.pgp>


More information about the xorg-devel mailing list