[2/2] mi: Sync: Don't free managed screen private

Submitted by Daniel Stone on Dec. 18, 2010, 12:57 a.m.

Details

Message ID 1292605035-13068-2-git-send-email-daniel@fooishbar.org
State Accepted, archived
Commit 469d5bf8b75038631c27edbb0f9cdf7d737fa233
Headers show

Not browsing as part of any series.

Commit Message

Daniel Stone Dec. 18, 2010, 12:57 a.m.
misync allocates space for its screen private with
dixRegisterPrivateKey, which means it doesn't have to free it at
CloseScreen time; doing so will, in fact, result in a crash.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
---
 miext/sync/misync.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

Patch hide | download patch | download mbox

diff --git a/miext/sync/misync.c b/miext/sync/misync.c
index bcc68a2..50226d9 100644
--- a/miext/sync/misync.c
+++ b/miext/sync/misync.c
@@ -167,7 +167,6 @@  SyncCloseScreen (int i, ScreenPtr pScreen)
     SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
 
     pScreen->CloseScreen = pScreenPriv->CloseScreen;
-    free(pScreenPriv);
 
     return (*pScreen->CloseScreen) (i, pScreen);
 }

Comments

On 12/17/10 8:57 AM, "Daniel Stone" <daniel@fooishbar.org> wrote:

> misync allocates space for its screen private with
> dixRegisterPrivateKey, which means it doesn't have to free it at
> CloseScreen time; doing so will, in fact, result in a crash.
> 
> Signed-off-by: Daniel Stone <daniel@fooishbar.org>
> ---
>  miext/sync/misync.c |    1 -
>  1 files changed, 0 insertions(+), 1 deletions(-)
> 
> diff --git a/miext/sync/misync.c b/miext/sync/misync.c
> index bcc68a2..50226d9 100644
> --- a/miext/sync/misync.c
> +++ b/miext/sync/misync.c
> @@ -167,7 +167,6 @@ SyncCloseScreen (int i, ScreenPtr pScreen)
>      SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
> 
>      pScreen->CloseScreen = pScreenPriv->CloseScreen;
> -    free(pScreenPriv);
> 
>      return (*pScreen->CloseScreen) (i, pScreen);
>  }
> --
> 1.7.2.3

Reviewed-by: James Jones <jajones@nvidia.com>

Thanks,
-James

> _______________________________________________
> xorg-devel@lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>

nvpublic