From 20cf0ef825e3f14b0688b691691e0aeba0a4860a Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 13 Mar 2012 10:21:23 +1000 Subject: Xext: strdup() the SystemSyncCounter name Required for future dynamic names. Signed-off-by: Peter Hutterer Reviewed-by: Jeremy Huddleston Reviewed-by: Jamey Sharp Reviewed-by: James Jones --- Xext/sync.c | 3 ++- Xext/syncsrv.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Xext/sync.c b/Xext/sync.c index 3c6ac5bd2..25379bbec 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -961,7 +961,7 @@ SyncCreateSystemCounter(const char *name, } pCounter->pSysCounterInfo = psci; psci->pCounter = pCounter; - psci->name = name; + psci->name = strdup(name); psci->resolution = resolution; psci->counterType = counterType; psci->QueryValue = QueryValue; @@ -1115,6 +1115,7 @@ FreeCounter(void *env, XID id) } if (IsSystemCounter(pCounter)) { xorg_list_del(&pCounter->pSysCounterInfo->entry); + free(pCounter->pSysCounterInfo->name); free(pCounter->pSysCounterInfo->private); free(pCounter->pSysCounterInfo); } diff --git a/Xext/syncsrv.h b/Xext/syncsrv.h index 2fa868790..d29c361cc 100644 --- a/Xext/syncsrv.h +++ b/Xext/syncsrv.h @@ -76,7 +76,7 @@ typedef void (*SyncSystemCounterBracketValues)(pointer counter, typedef struct _SysCounterInfo { SyncCounter *pCounter; - const char *name; + char *name; CARD64 resolution; CARD64 bracket_greater; CARD64 bracket_less; -- cgit v1.2.3