[PATCH v2 7/9] Xext: strdup() the SystemSyncCounter name
Peter Hutterer
peter.hutterer at who-t.net
Wed Mar 14 21:10:28 PDT 2012
Required for future dynamic names.
Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
Reviewed-by: Jeremy Huddleston <jeremyhu at apple.com>
---
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 4c63f64..f7a660f 100644
--- a/Xext/sync.c
+++ b/Xext/sync.c
@@ -1014,7 +1014,7 @@ SyncCreateSystemCounter(
}
pCounter->pSysCounterInfo = psci;
psci->pCounter = pCounter;
- psci->name = name;
+ psci->name = strdup(name);
psci->resolution = resolution;
psci->counterType = counterType;
psci->QueryValue = QueryValue;
@@ -1178,6 +1178,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 d252935..27b533c 100644
--- a/Xext/syncsrv.h
+++ b/Xext/syncsrv.h
@@ -74,7 +74,7 @@ typedef void (*SyncSystemCounterBracketValues)(pointer counter,
typedef struct _SysCounterInfo {
SyncCounter *pCounter;
- 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