diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-07-02 14:11:38 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-07-02 14:11:38 +0200 |
commit | 1dbd3c888a3eee51db5303bd93e95b84999f5d31 (patch) | |
tree | 84db92271726b42b8c0864c8b7c77b2330566fc1 /nx-X11/programs/Xserver/dix/extension.c | |
parent | 279d37127db241a9ee685f6b671f51aa21a972ea (diff) | |
parent | e85808245810d0cc6918104deef25213d5f9e06c (diff) | |
download | nx-libs-1dbd3c888a3eee51db5303bd93e95b84999f5d31.tar.gz nx-libs-1dbd3c888a3eee51db5303bd93e95b84999f5d31.tar.bz2 nx-libs-1dbd3c888a3eee51db5303bd93e95b84999f5d31.zip |
Merge branch 'sunweaver-pr/backport-Xorg-memory-handling' into 3.6.x
Attributes GH PR #159: https://github.com/ArcticaProject/nx-libs/pull/159
Reviewed by: Vadim Troshchinskiy <vadim@qindel.com> -- Fri, 01 Jul 2016 12:47:46 -0700
Diffstat (limited to 'nx-X11/programs/Xserver/dix/extension.c')
-rw-r--r-- | nx-X11/programs/Xserver/dix/extension.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/nx-X11/programs/Xserver/dix/extension.c b/nx-X11/programs/Xserver/dix/extension.c index fe51f8916..b0859757b 100644 --- a/nx-X11/programs/Xserver/dix/extension.c +++ b/nx-X11/programs/Xserver/dix/extension.c @@ -95,25 +95,25 @@ AddExtension(char *name, int NumEvents, int NumErrors, (unsigned)(lastError + NumErrors > LAST_ERROR)) return((ExtensionEntry *) NULL); - ext = (ExtensionEntry *) xalloc(sizeof(ExtensionEntry)); + ext = (ExtensionEntry *) malloc(sizeof(ExtensionEntry)); if (!ext) return((ExtensionEntry *) NULL); - ext->name = (char *)xalloc(strlen(name) + 1); + ext->name = (char *)malloc(strlen(name) + 1); ext->num_aliases = 0; ext->aliases = (char **)NULL; if (!ext->name) { - xfree(ext); + free(ext); return((ExtensionEntry *) NULL); } strcpy(ext->name, name); i = NumExtensions; - newexts = (ExtensionEntry **) xrealloc(extensions, + newexts = (ExtensionEntry **) realloc(extensions, (i + 1) * sizeof(ExtensionEntry *)); if (!newexts) { - xfree(ext->name); - xfree(ext); + free(ext->name); + free(ext); return((ExtensionEntry *) NULL); } NumExtensions++; @@ -159,12 +159,12 @@ Bool AddExtensionAlias(char *alias, ExtensionEntry *ext) char *name; char **aliases; - aliases = (char **)xrealloc(ext->aliases, + aliases = (char **)realloc(ext->aliases, (ext->num_aliases + 1) * sizeof(char *)); if (!aliases) return FALSE; ext->aliases = aliases; - name = (char *)xalloc(strlen(alias) + 1); + name = (char *)malloc(strlen(alias) + 1); if (!name) return FALSE; strcpy(name, alias); @@ -263,13 +263,13 @@ CloseDownExtensions() if (extensions[i]->CloseDown) (* extensions[i]->CloseDown)(extensions[i]); NumExtensions = i; - xfree(extensions[i]->name); + free(extensions[i]->name); for (j = extensions[i]->num_aliases; --j >= 0;) - xfree(extensions[i]->aliases[j]); - xfree(extensions[i]->aliases); - xfree(extensions[i]); + free(extensions[i]->aliases[j]); + free(extensions[i]->aliases); + free(extensions[i]); } - xfree(extensions); + free(extensions); extensions = (ExtensionEntry **)NULL; lastEvent = EXTENSION_EVENT_BASE; lastError = FirstExtensionError; @@ -280,9 +280,9 @@ CloseDownExtensions() while (spentry->num) { spentry->num--; - xfree(spentry->procList[spentry->num].name); + free(spentry->procList[spentry->num].name); } - xfree(spentry->procList); + free(spentry->procList); spentry->procList = (ProcEntryPtr)NULL; } } @@ -438,15 +438,15 @@ RegisterScreenProc(char *name, ScreenPtr pScreen, ExtensionLookupProc proc) procEntry->proc = proc; else { - newname = (char *)xalloc(strlen(name)+1); + newname = (char *)malloc(strlen(name)+1); if (!newname) return FALSE; procEntry = (ProcEntryPtr) - xrealloc(spentry->procList, + realloc(spentry->procList, sizeof(ProcEntryRec) * (spentry->num+1)); if (!procEntry) { - xfree(newname); + free(newname); return FALSE; } spentry->procList = procEntry; |