[PATCH 7/9] Xext: strdup() the SystemSyncCounter name

Peter Hutterer peter.hutterer at who-t.net
Tue Mar 13 22:47:24 PDT 2012


Required for future dynamic names.

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 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 df0aa0d..81f20db 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -1011,7 +1011,7 @@ SyncCreateSystemCounter(
 	    return pCounter;
 	}
 	pCounter->pSysCounterInfo = psci;
-	psci->name = name;
+	psci->name = strdup(name);
 	psci->resolution = resolution;
 	psci->counterType = counterType;
 	psci->QueryValue = QueryValue;
@@ -1176,6 +1176,7 @@ FreeCounter(void *env, XID id)
     {
 	int i, found = 0;
 
+	free(pCounter->pSysCounterInfo->name);
 	free(pCounter->pSysCounterInfo->private);
 	free(pCounter->pSysCounterInfo);
 
diff --git a/Xext/syncsrv.h b/Xext/syncsrv.h
index beb28b0..ebd90d4 100644
--- a/Xext/syncsrv.h
+++ b/Xext/syncsrv.h
@@ -74,7 +74,7 @@ typedef void (*SyncSystemCounterBracketValues)(pointer counter,
 #define SYSCOUNTERPRIV(counter) (((SyncCounter*)(counter))->pSysCounterInfo->private)
 
 typedef struct _SysCounterInfo {
-    const char	*name;
+    char	*name;
     CARD64	resolution;
     CARD64	bracket_greater;
     CARD64	bracket_less;
-- 
1.7.7.6



More information about the xorg-devel mailing list