summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-03-13 10:21:23 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-03-22 13:12:56 +1000
commit20cf0ef825e3f14b0688b691691e0aeba0a4860a (patch)
treeed611071d7d1ef61b9b85926cd57f8d1b61d5472
parentf1b28aea4156f0381ea733ad2afbdd1f34f75599 (diff)
Xext: strdup() the SystemSyncCounter name
Required for future dynamic names. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jamey Sharp <jamey@minilop.net> Reviewed-by: James Jones <jajones@nvidia.com>
-rw-r--r--Xext/sync.c3
-rw-r--r--Xext/syncsrv.h2
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;