aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/extension.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-06-11 12:14:52 +0000
committermarha <marha@users.sourceforge.net>2010-06-11 12:14:52 +0000
commit4c61bf84b11e26e6f22648668c95ea760a379163 (patch)
tree0ac762ab2815eae283dded7447ad7cb5a54b926a /xorg-server/dix/extension.c
parente1dabd2ce8be0d70c6c15353b58de256129dfd1f (diff)
downloadvcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.tar.gz
vcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.tar.bz2
vcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.zip
xserver git update 11/6/2010
Diffstat (limited to 'xorg-server/dix/extension.c')
-rw-r--r--xorg-server/dix/extension.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/xorg-server/dix/extension.c b/xorg-server/dix/extension.c
index 57aef003f..f6b33d64c 100644
--- a/xorg-server/dix/extension.c
+++ b/xorg-server/dix/extension.c
@@ -89,15 +89,19 @@ AddExtension(char *name, int NumEvents, int NumErrors,
return((ExtensionEntry *) NULL);
}
- ext = malloc(sizeof(ExtensionEntry));
+ ext = calloc(sizeof (ExtensionEntry), 1);
if (!ext)
- return(NULL);
+ return NULL;
+ if (!dixAllocatePrivates(&ext->devPrivates, PRIVATE_EXTENSION)) {
+ free(ext);
+ return NULL;
+ }
ext->name = malloc(strlen(name) + 1);
ext->num_aliases = 0;
ext->aliases = (char **)NULL;
- ext->devPrivates = NULL;
if (!ext->name)
{
+ dixFreePrivates(ext->devPrivates, PRIVATE_EXTENSION);
free(ext);
return((ExtensionEntry *) NULL);
}
@@ -108,6 +112,7 @@ AddExtension(char *name, int NumEvents, int NumErrors,
if (!newexts)
{
free(ext->name);
+ dixFreePrivates(ext->devPrivates, PRIVATE_EXTENSION);
free(ext);
return((ExtensionEntry *) NULL);
}
@@ -144,7 +149,7 @@ AddExtension(char *name, int NumEvents, int NumErrors,
}
RegisterExtensionNames(ext);
- return(ext);
+ return ext;
}
Bool AddExtensionAlias(char *alias, ExtensionEntry *ext)
@@ -253,7 +258,7 @@ CloseDownExtensions(void)
for (j = extensions[i]->num_aliases; --j >= 0;)
free(extensions[i]->aliases[j]);
free(extensions[i]->aliases);
- dixFreePrivates(extensions[i]->devPrivates);
+ dixFreePrivates(extensions[i]->devPrivates, PRIVATE_EXTENSION);
free(extensions[i]);
}
free(extensions);
@@ -330,7 +335,7 @@ ProcListExtensions(ClientPtr client)
reply.length = bytes_to_int32(total_length);
buffer = bufptr = malloc(total_length);
if (!buffer)
- return(BadAlloc);
+ return BadAlloc;
for (i=0; i<NumExtensions; i++)
{
int len;