mirror of
https://github.com/X11Libre/xserver.git
synced 2026-11-27 07:23:40 +00:00
Xext: sync: handle strdup() alloc fail in SyncCreateSystemCounter()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
3000f4d175
commit
85c14b9f30
1 changed files with 6 additions and 1 deletions
|
|
@ -1033,7 +1033,12 @@ SyncCreateSystemCounter(const char *name,
|
|||
}
|
||||
pCounter->pSysCounterInfo = psci;
|
||||
psci->pCounter = pCounter;
|
||||
psci->name = strdup(name);
|
||||
if (!(psci->name = strdup(name))) {
|
||||
free(psci);
|
||||
pCounter->pSysCounterInfo = NULL;
|
||||
FreeResource(pCounter->sync.id, X11_RESTYPE_NONE);
|
||||
return NULL;
|
||||
}
|
||||
psci->resolution = resolution;
|
||||
psci->counterType = counterType;
|
||||
psci->QueryValue = QueryValue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue