diff options
author | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-05-06 01:44:06 +0700 |
---|---|---|
committer | Mikhail Gusarov <dottedmag@dottedmag.net> | 2010-05-13 00:22:37 +0700 |
commit | 3f3ff971ecff9936cebafc813af9193b97bba89c (patch) | |
tree | fdbbad794a42488b7ffe41eed7aba4e498335f55 /Xext/xselinux_ext.c | |
parent | 96c7ab27c383ec767f62a7a11e5fd76f86363fbc (diff) |
Replace X-allocation functions with their C89 counterparts
The only remaining X-functions used in server are XNF*, the rest is converted to
plain alloc/calloc/realloc/free/strdup.
X* functions are still exported from server and x* macros are still defined in
header file, so both ABI and API are not affected by this change.
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xext/xselinux_ext.c')
-rw-r--r-- | Xext/xselinux_ext.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Xext/xselinux_ext.c b/Xext/xselinux_ext.c index aa5573455..4d55e1565 100644 --- a/Xext/xselinux_ext.c +++ b/Xext/xselinux_ext.c @@ -52,7 +52,7 @@ typedef struct { static security_context_t SELinuxCopyContext(char *ptr, unsigned len) { - security_context_t copy = xalloc(len + 1); + security_context_t copy = malloc(len + 1); if (!copy) return NULL; strncpy(copy, ptr, len); @@ -141,7 +141,7 @@ ProcSELinuxSetCreateContext(ClientPtr client, unsigned offset) rc = BadValue; } - xfree(ctx); + free(ctx); return rc; } @@ -198,7 +198,7 @@ ProcSELinuxSetDeviceContext(ClientPtr client) rc = Success; out: - xfree(ctx); + free(ctx); return rc; } @@ -334,7 +334,7 @@ SELinuxFreeItems(SELinuxListItemRec *items, int count) freecon(items[k].octx); freecon(items[k].dctx); } - xfree(items); + free(items); } static int @@ -345,7 +345,7 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec *items, SELinuxListItemsReply rep; CARD32 *buf; - buf = xcalloc(size, sizeof(CARD32)); + buf = calloc(size, sizeof(CARD32)); if (size && !buf) { rc = BadAlloc; goto out; @@ -391,7 +391,7 @@ SELinuxSendItemsToClient(ClientPtr client, SELinuxListItemRec *items, /* Free stuff and return */ rc = client->noClientException; - xfree(buf); + free(buf); out: SELinuxFreeItems(items, count); return rc; @@ -417,7 +417,7 @@ ProcSELinuxListProperties(ClientPtr client) count = 0; for (pProp = wUserProps(pWin); pProp; pProp = pProp->next) count++; - items = xcalloc(count, sizeof(SELinuxListItemRec)); + items = calloc(count, sizeof(SELinuxListItemRec)); if (count && !items) return BadAlloc; @@ -451,7 +451,7 @@ ProcSELinuxListSelections(ClientPtr client) count = 0; for (pSel = CurrentSelections; pSel; pSel = pSel->next) count++; - items = xcalloc(count, sizeof(SELinuxListItemRec)); + items = calloc(count, sizeof(SELinuxListItemRec)); if (count && !items) return BadAlloc; |