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/lib | |
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/lib')
-rw-r--r-- | nx-X11/lib/xtrans/Xtrans.c | 72 | ||||
-rw-r--r-- | nx-X11/lib/xtrans/Xtransdnet.c | 26 | ||||
-rw-r--r-- | nx-X11/lib/xtrans/Xtranslcl.c | 52 | ||||
-rw-r--r-- | nx-X11/lib/xtrans/Xtransos2.c | 106 | ||||
-rw-r--r-- | nx-X11/lib/xtrans/Xtranssock.c | 56 | ||||
-rw-r--r-- | nx-X11/lib/xtrans/Xtranstli.c | 38 | ||||
-rw-r--r-- | nx-X11/lib/xtrans/Xtransutil.c | 14 | ||||
-rw-r--r-- | nx-X11/lib/xtrans/transport.c | 4 |
8 files changed, 182 insertions, 186 deletions
diff --git a/nx-X11/lib/xtrans/Xtrans.c b/nx-X11/lib/xtrans/Xtrans.c index ef4d64aed..934335269 100644 --- a/nx-X11/lib/xtrans/Xtrans.c +++ b/nx-X11/lib/xtrans/Xtrans.c @@ -145,15 +145,15 @@ TRANS(FreeConnInfo) (XtransConnInfo ciptr) PRMSG (3,"FreeConnInfo(%p)\n", ciptr, 0, 0); if (ciptr->addr) - xfree (ciptr->addr); + free (ciptr->addr); if (ciptr->peeraddr) - xfree (ciptr->peeraddr); + free (ciptr->peeraddr); if (ciptr->port) - xfree (ciptr->port); + free (ciptr->port); - xfree ((char *) ciptr); + free ((char *) ciptr); } @@ -221,7 +221,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) /* Copy the string so it can be changed */ - tmpptr = mybuf = (char *) xalloc (strlen (address) + 1); + tmpptr = mybuf = (char *) malloc (strlen (address) + 1); strcpy (mybuf, address); /* Parse the string to get each component */ @@ -238,7 +238,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) *protocol = NULL; *host = NULL; *port = NULL; - xfree (tmpptr); + free (tmpptr); return 0; } @@ -288,7 +288,7 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) *protocol = NULL; *host = NULL; *port = NULL; - xfree (tmpptr); + free (tmpptr); return 0; } @@ -362,46 +362,46 @@ TRANS(ParseAddress) (char *address, char **protocol, char **host, char **port) * string space for them. */ - if ((*protocol = (char *) xalloc(strlen (_protocol) + 1)) == NULL) + if ((*protocol = (char *) malloc(strlen (_protocol) + 1)) == NULL) { /* Malloc failed */ *port = NULL; *host = NULL; *protocol = NULL; - xfree (tmpptr); + free (tmpptr); return 0; } else strcpy (*protocol, _protocol); - if ((*host = (char *) xalloc (strlen (_host) + 1)) == NULL) + if ((*host = (char *) malloc (strlen (_host) + 1)) == NULL) { /* Malloc failed */ *port = NULL; *host = NULL; - xfree (*protocol); + free (*protocol); *protocol = NULL; - xfree (tmpptr); + free (tmpptr); return 0; } else strcpy (*host, _host); - if ((*port = (char *) xalloc (strlen (_port) + 1)) == NULL) + if ((*port = (char *) malloc (strlen (_port) + 1)) == NULL) { /* Malloc failed */ *port = NULL; - xfree (*host); + free (*host); *host = NULL; - xfree (*protocol); + free (*protocol); *protocol = NULL; - xfree (tmpptr); + free (tmpptr); return 0; } else strcpy (*port, _port); - xfree (tmpptr); + free (tmpptr); return 1; } @@ -446,9 +446,9 @@ TRANS(Open) (int type, char *address) PRMSG (1,"Open: Unable to find transport for %s\n", protocol, 0, 0); - xfree (protocol); - xfree (host); - xfree (port); + free (protocol); + free (host); + free (port); return NULL; } @@ -487,17 +487,17 @@ TRANS(Open) (int type, char *address) PRMSG (1,"Open: transport open failed for %s/%s:%s\n", protocol, host, port); } - xfree (protocol); - xfree (host); - xfree (port); + free (protocol); + free (host); + free (port); return NULL; } ciptr->transptr = thistrans; ciptr->port = port; /* We need this for TRANS(Reopen) */ - xfree (protocol); - xfree (host); + free (protocol); + free (host); return ciptr; } @@ -539,7 +539,7 @@ TRANS(Reopen) (int type, int trans_id, int fd, char *port) return NULL; } - if ((save_port = (char *) xalloc (strlen (port) + 1)) == NULL) + if ((save_port = (char *) malloc (strlen (port) + 1)) == NULL) { PRMSG (1,"Reopen: Unable to malloc port string\n", 0, 0, 0); @@ -668,7 +668,7 @@ TRANS(GetReopenInfo) (XtransConnInfo ciptr, *trans_id = Xtransports[i].transport_id; *fd = ciptr->fd; - if ((*port = (char *) xalloc (strlen (ciptr->port) + 1)) == NULL) + if ((*port = (char *) malloc (strlen (ciptr->port) + 1)) == NULL) return 0; else { @@ -859,16 +859,16 @@ TRANS(Connect) (XtransConnInfo ciptr, char *address) { PRMSG (1,"Connect: Missing port specification in %s\n", address, 0, 0); - if (protocol) xfree (protocol); - if (host) xfree (host); + if (protocol) free (protocol); + if (host) free (host); return -1; } ret = ciptr->transptr->Connect (ciptr, host, port); - if (protocol) xfree (protocol); - if (host) xfree (host); - if (port) xfree (port); + if (protocol) free (protocol); + if (host) free (host); + if (port) free (port); return ret; } @@ -966,7 +966,7 @@ TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp, *familyp = ciptr->family; *addrlenp = ciptr->addrlen; - if ((*addrp = (Xtransaddr *) xalloc (ciptr->addrlen)) == NULL) + if ((*addrp = (Xtransaddr *) malloc (ciptr->addrlen)) == NULL) { PRMSG (1,"GetMyAddr: malloc failed\n", 0, 0, 0); return -1; @@ -986,7 +986,7 @@ TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp, *familyp = ciptr->family; *addrlenp = ciptr->peeraddrlen; - if ((*addrp = (Xtransaddr *) xalloc (ciptr->peeraddrlen)) == NULL) + if ((*addrp = (Xtransaddr *) malloc (ciptr->peeraddrlen)) == NULL) { PRMSG (1,"GetPeerAddr: malloc failed\n", 0, 0, 0); return -1; @@ -1141,7 +1141,7 @@ TRANS(MakeAllCOTSServerListeners) (char *port, int *partial, int *count_ret, if (*count_ret > 0) { - if ((*ciptrs_ret = (XtransConnInfo *) xalloc ( + if ((*ciptrs_ret = (XtransConnInfo *) malloc ( *count_ret * sizeof (XtransConnInfo))) == NULL) { return -1; @@ -1239,7 +1239,7 @@ TRANS(MakeAllCLTSServerListeners) (char *port, int *partial, int *count_ret, if (*count_ret > 0) { - if ((*ciptrs_ret = (XtransConnInfo *) xalloc ( + if ((*ciptrs_ret = (XtransConnInfo *) malloc ( *count_ret * sizeof (XtransConnInfo))) == NULL) { return -1; diff --git a/nx-X11/lib/xtrans/Xtransdnet.c b/nx-X11/lib/xtrans/Xtransdnet.c index a1728f187..00a086277 100644 --- a/nx-X11/lib/xtrans/Xtransdnet.c +++ b/nx-X11/lib/xtrans/Xtransdnet.c @@ -121,7 +121,7 @@ TRANS(DNETGetAddr) (XtransConnInfo ciptr) * Everything looks good: fill in the XtransConnInfo structure. */ - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->addr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "DNETGetAddr: Can't allocate space for the addr\n", 0, 0, 0); @@ -161,7 +161,7 @@ TRANS(DNETGetPeerAddr) (XtransConnInfo ciptr) * Everything looks good: fill in the XtransConnInfo structure. */ - if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "DNETGetPeerAddr: Can't allocate space for the addr\n", @@ -187,7 +187,7 @@ TRANS(DNETOpenCOTSClient) (Xtransport *thistrans, char *protocol, PRMSG (2,"DNETOpenCOTSClient(%s,%s,%s)\n", protocol, host, port); - if ((ciptr = (XtransConnInfo) xcalloc ( + if ((ciptr = (XtransConnInfo) calloc ( 1, sizeof(struct _XtransConnInfo))) == NULL) { PRMSG (1, "DNETOpenCOTSClient: malloc failed\n", 0, 0, 0); @@ -215,7 +215,7 @@ TRANS(DNETOpenCOTSServer) (Xtransport *thistrans, char *protocol, PRMSG (2,"DNETOpenCOTSServer(%s,%s,%s)\n", protocol, host, port); - if ((ciptr = (XtransConnInfo) xcalloc ( + if ((ciptr = (XtransConnInfo) calloc ( 1, sizeof(struct _XtransConnInfo))) == NULL) { PRMSG (1, "DNETOpenCOTSServer: malloc failed\n", 0, 0, 0); @@ -224,7 +224,7 @@ TRANS(DNETOpenCOTSServer) (Xtransport *thistrans, char *protocol, if ((ciptr->fd = socket (AF_DECnet, SOCK_STREAM, 0)) < 0) { - xfree ((char *) ciptr); + free ((char *) ciptr); return NULL; } @@ -247,7 +247,7 @@ TRANS(DNETOpenCLTSClient) (Xtransport *thistrans, char *protocol, PRMSG (2,"DNETOpenCLTSClient(%s,%s,%s)\n", protocol, host, port); - if ((ciptr = (XtransConnInfo) xcalloc ( + if ((ciptr = (XtransConnInfo) calloc ( 1, sizeof (struct _XtransConnInfo))) == NULL) { PRMSG (1, "DNETOpenCLTSClient: malloc failed\n", 0, 0, 0); @@ -290,7 +290,7 @@ TRANS(DNETReopenCOTSServer) (Xtransport *thistrans, int fd, char *port) PRMSG (2,"DNETReopenCOTSServer(%d,%s)\n", fd, port, 0); - if ((ciptr = (XtransConnInfo) xcalloc ( + if ((ciptr = (XtransConnInfo) calloc ( 1, sizeof(struct _XtransConnInfo))) == NULL) { PRMSG (1, "DNETReopenCOTSServer: malloc failed\n", 0, 0, 0); @@ -311,7 +311,7 @@ TRANS(DNETReopenCLTSServer) (Xtransport *thistrans, int fd, char *port) PRMSG (2,"DNETReopenCLTSServer(%d,%s)\n", fd, port, 0); - if ((ciptr = (XtransConnInfo) xcalloc ( + if ((ciptr = (XtransConnInfo) calloc ( 1, sizeof(struct _XtransConnInfo))) == NULL) { PRMSG (1, "DNETReopenCLTSServer: malloc failed\n", 0, 0, 0); @@ -393,7 +393,7 @@ TRANS(DNETAccept) (XtransConnInfo ciptr, int *status) PRMSG (2, "DNETAccept(%x,%d)\n", ciptr, ciptr->fd, 0); - if ((newciptr = (XtransConnInfo) xcalloc( + if ((newciptr = (XtransConnInfo) calloc( 1, sizeof (struct _XtransConnInfo))) == NULL) { PRMSG (1, "DNETAccept: malloc failed\n", 0, 0, 0); @@ -406,7 +406,7 @@ TRANS(DNETAccept) (XtransConnInfo ciptr, int *status) { PRMSG (1, "DNETAccept: accept() failed\n", 0, 0, 0); - xfree (newciptr); + free (newciptr); *status = TRANS_ACCEPT_FAILED; return NULL; } @@ -421,7 +421,7 @@ TRANS(DNETAccept) (XtransConnInfo ciptr, int *status) PRMSG(1, "DNETAccept: ...DNETGetAddr() failed:\n", 0, 0, 0); close (newciptr->fd); - xfree (newciptr); + free (newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } @@ -432,8 +432,8 @@ TRANS(DNETAccept) (XtransConnInfo ciptr, int *status) "DNETAccept: ...DNETGetPeerAddr() failed:\n", 0, 0, 0); close (newciptr->fd); - if (newciptr->addr) xfree (newciptr->addr); - xfree (newciptr); + if (newciptr->addr) free (newciptr->addr); + free (newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } diff --git a/nx-X11/lib/xtrans/Xtranslcl.c b/nx-X11/lib/xtrans/Xtranslcl.c index 6165d3658..52e845124 100644 --- a/nx-X11/lib/xtrans/Xtranslcl.c +++ b/nx-X11/lib/xtrans/Xtranslcl.c @@ -144,7 +144,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path) ciptr->family = AF_UNIX; ciptr->addrlen = sizeof (struct sockaddr_un); - if ((sunaddr = (struct sockaddr_un *) xalloc (ciptr->addrlen)) == NULL) + if ((sunaddr = (struct sockaddr_un *) malloc (ciptr->addrlen)) == NULL) { PRMSG(1,"FillAddrInfo: failed to allocate memory for addr\n", 0, 0, 0); return 0; @@ -165,13 +165,13 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path) ciptr->peeraddrlen = sizeof (struct sockaddr_un); - if ((p_sunaddr = (struct sockaddr_un *) xalloc ( + if ((p_sunaddr = (struct sockaddr_un *) malloc ( ciptr->peeraddrlen)) == NULL) { PRMSG(1, "FillAddrInfo: failed to allocate memory for peer addr\n", 0,0,0); - xfree ((char *) sunaddr); + free ((char *) sunaddr); ciptr->addr = NULL; return 0; @@ -596,7 +596,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) */ newciptr->addrlen=ciptr->addrlen; - if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) { + if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) { PRMSG(1,"PTSAccept: failed to allocate memory for peer addr\n", 0,0,0); close(newfd); @@ -607,10 +607,10 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen); newciptr->peeraddrlen=sizeof(struct sockaddr_un); - if( (sunaddr=(struct sockaddr_un *)xalloc(newciptr->peeraddrlen)) == NULL ) { + if( (sunaddr=(struct sockaddr_un *)malloc(newciptr->peeraddrlen)) == NULL ) { PRMSG(1,"PTSAccept: failed to allocate memory for peer addr\n", 0,0,0); - xfree(newciptr->addr); + free(newciptr->addr); close(newfd); *status = TRANS_ACCEPT_BAD_MALLOC; return -1; @@ -818,7 +818,7 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) */ newciptr->addrlen=ciptr->addrlen; - if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) { + if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) { PRMSG(1, "NAMEDAccept: failed to allocate memory for peer addr\n", 0,0,0); @@ -830,11 +830,11 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen); newciptr->peeraddrlen=newciptr->addrlen; - if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) { + if( (newciptr->peeraddr=(char *)malloc(newciptr->peeraddrlen)) == NULL ) { PRMSG(1, "NAMEDAccept: failed to allocate memory for peer addr\n", 0,0,0); - xfree(newciptr->addr); + free(newciptr->addr); close(str.fd); *status = TRANS_ACCEPT_BAD_MALLOC; return -1; @@ -1162,7 +1162,7 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) */ newciptr->addrlen=ciptr->addrlen; - if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) { + if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) { PRMSG(1, "ISCAccept: failed to allocate memory for peer addr\n", 0,0,0); @@ -1174,11 +1174,11 @@ TRANS(ISCAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) memcpy(newciptr->addr,ciptr->addr,newciptr->addrlen); newciptr->peeraddrlen=newciptr->addrlen; - if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) { + if( (newciptr->peeraddr=(char *)malloc(newciptr->peeraddrlen)) == NULL ) { PRMSG(1, "ISCAccept: failed to allocate memory for peer addr\n", 0,0,0); - xfree(newciptr->addr); + free(newciptr->addr); close(str.fd); *status = TRANS_ACCEPT_BAD_MALLOC; return -1; @@ -1436,7 +1436,7 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) */ newciptr->addrlen=ciptr->addrlen; - if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) { + if( (newciptr->addr=(char *)malloc(newciptr->addrlen)) == NULL ) { PRMSG(1, "SCOAccept: failed to allocate memory for peer addr\n", 0,0,0); @@ -1451,11 +1451,11 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status) #endif newciptr->peeraddrlen=newciptr->addrlen; - if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) { + if( (newciptr->peeraddr=(char *)malloc(newciptr->peeraddrlen)) == NULL ) { PRMSG(1, "SCOAccept: failed to allocate memory for peer addr\n", 0,0,0); - xfree(newciptr->addr); + free(newciptr->addr); close(fd); *status = TRANS_ACCEPT_BAD_MALLOC; return -1; @@ -1894,7 +1894,7 @@ TRANS(LocalInitTransports)(char *protocol) if( strcmp(protocol,"local") && strcmp(protocol,"LOCAL") ) { - workingXLOCAL=freeXLOCAL=(char *)xalloc (strlen (protocol) + 1); + workingXLOCAL=freeXLOCAL=(char *)malloc (strlen (protocol) + 1); if (workingXLOCAL) strcpy (workingXLOCAL, protocol); } @@ -1902,7 +1902,7 @@ TRANS(LocalInitTransports)(char *protocol) XLOCAL=(char *)getenv("XLOCAL"); if(XLOCAL==NULL) XLOCAL=DEF_XLOCAL; - workingXLOCAL=freeXLOCAL=(char *)xalloc (strlen (XLOCAL) + 1); + workingXLOCAL=freeXLOCAL=(char *)malloc (strlen (XLOCAL) + 1); if (workingXLOCAL) strcpy (workingXLOCAL, XLOCAL); } @@ -1913,7 +1913,7 @@ TRANS(LocalEndTransports)(void) { PRMSG(3,"LocalEndTransports()\n", 0,0,0 ); - xfree(freeXLOCAL); + free(freeXLOCAL); } #define TYPEBUFSIZE 32 @@ -2038,7 +2038,7 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port) */ #endif /* X11_t */ - if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL ) + if( (ciptr=(XtransConnInfo)calloc(1,sizeof(struct _XtransConnInfo))) == NULL ) { PRMSG(1,"LocalOpenClient: calloc(1,%d) failed\n", sizeof(struct _XtransConnInfo),0,0 ); @@ -2080,7 +2080,7 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port) if( ciptr->fd < 0 ) { - xfree(ciptr); + free(ciptr); return NULL; } @@ -2113,7 +2113,7 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port) */ #endif /* X11_t */ - if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL ) + if( (ciptr=(XtransConnInfo)calloc(1,sizeof(struct _XtransConnInfo))) == NULL ) { PRMSG(1,"LocalOpenServer: calloc(1,%d) failed\n", sizeof(struct _XtransConnInfo),0,0 ); @@ -2150,7 +2150,7 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host, char *port) } } - xfree(ciptr); + free(ciptr); return NULL; } @@ -2168,7 +2168,7 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port) PRMSG(2,"LocalReopenServer(%d,%d,%d)\n", type, index, fd); - if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL ) + if( (ciptr=(XtransConnInfo)calloc(1,sizeof(struct _XtransConnInfo))) == NULL ) { PRMSG(1,"LocalReopenServer: calloc(1,%d) failed\n", sizeof(struct _XtransConnInfo),0,0 ); @@ -2197,7 +2197,7 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port) return ciptr; } - xfree(ciptr); + free(ciptr); return NULL; } @@ -2384,7 +2384,7 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status) transptr=(LOCALtrans2dev *)ciptr->priv; - if( (newciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo)))==NULL ) + if( (newciptr=(XtransConnInfo)calloc(1,sizeof(struct _XtransConnInfo)))==NULL ) { PRMSG(1,"LocalAccept: calloc(1,%d) failed\n", sizeof(struct _XtransConnInfo),0,0 ); @@ -2396,7 +2396,7 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status) if( newciptr->fd < 0 ) { - xfree(newciptr); + free(newciptr); return NULL; } diff --git a/nx-X11/lib/xtrans/Xtransos2.c b/nx-X11/lib/xtrans/Xtransos2.c index f4a6b036b..1380403da 100644 --- a/nx-X11/lib/xtrans/Xtransos2.c +++ b/nx-X11/lib/xtrans/Xtransos2.c @@ -90,7 +90,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, PRMSG(5, "Os2OpenClient: Creating pipe %s\n",pipename, 0,0 ); /* make a connection entry */ - if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL ) { + if( (ciptr=(XtransConnInfo)calloc(1,sizeof(struct _XtransConnInfo))) == NULL ) { PRMSG(1,"Os2OpenClient: calloc(1,%d) failed\n", sizeof(struct _XtransConnInfo),0,0 ); return NULL; @@ -111,7 +111,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, 0,0,0 ); PRMSG(1,"\tor the DISPLAY variable is set incorrectly.\n", 0,0,0 ); - xfree(ciptr); + free(ciptr); return NULL; } try ++; @@ -133,7 +133,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, pipe_len=0; DosWrite(hServer,&pipe_len,1,&byteWritten); DosClose(hServer); - xfree(ciptr); + free(ciptr); return(NULL); } @@ -145,7 +145,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, PRMSG(1, "Os2OpenClient: Unable to connect to pipe %s\n", pipename,0,0 ); DosClose (hfd); DosClose(hServer); - xfree(ciptr); + free(ciptr); return (NULL); } @@ -158,7 +158,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, hServer,rc,byteWritten ); DosClose(hServer); DosClose(hfd); - xfree(ciptr); + free(ciptr); return(NULL); } @@ -182,7 +182,7 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, PRMSG(1, "\tor the XServer is too busy to respond.\n",0,0,0 ); DosClose(hServer); DosClose(hfd); - xfree(ciptr); + free(ciptr); return(NULL); } @@ -197,30 +197,30 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, PRMSG(1, "Os2OpenClient: Client pipe does not appear connected. rc=%d, h=%d\n",rc,hfd,0 ); PRMSG(1, "\tProbable cause: the XServer has just exited.\n",0,0,0 ); DosClose(hfd); - xfree(ciptr); + free(ciptr); return(NULL); } namelen=sizeof(struct sockaddr); - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->addr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2OpenClient: Can't allocate space for the addr\n", 0, 0, 0); DosClose(hfd); - xfree(ciptr); + free(ciptr); return(NULL); } ciptr->addrlen = namelen; ((struct sockaddr *)ciptr->addr)->sa_family = AF_UNIX; strcpy(((struct sockaddr *)ciptr->addr)->sa_data, "local"); - if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2OpenCLient: Can't allocate space for the addr\n", 0, 0, 0); DosClose(hfd); - xfree(ciptr->addr); - xfree(ciptr); + free(ciptr->addr); + free(ciptr); return(NULL); } ciptr->peeraddrlen = namelen; @@ -237,9 +237,9 @@ TRANS(Os2OpenClient)(Xtransport *thistrans, char *protocol, PRMSG(1, "Os2OpenClient: Could not import the pipe handle into EMX\n",0,0,0 ); PRMSG(1, "\tProbable cause: EMX has run out of free file handles.\n",0,0,0 ); DosClose(hfd); - xfree(ciptr->addr); - xfree(ciptr->peeraddr); - xfree(ciptr); + free(ciptr->addr); + free(ciptr->peeraddr); + free(ciptr); return(NULL); } PRMSG(5, "Os2OpenClient: pipe handle %d EMX handle %d\n",ciptr->index,ciptr->fd,0 ); @@ -268,9 +268,9 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol, PRMSG(2,"Os2OpenServer(%s,%s,%s)\n",protocol,host,port); - if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL ) + if( (ciptr=(XtransConnInfo)calloc(1,sizeof(struct _XtransConnInfo))) == NULL ) { - PRMSG(1,"Os2OpenServer: xcalloc(1,%d) failed\n", + PRMSG(1,"Os2OpenServer: calloc(1,%d) failed\n", sizeof(struct _XtransConnInfo),0,0 ); return NULL; } @@ -296,7 +296,7 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol, PRMSG(1, "Os2OpenServer: Unable to create pipe %s, rc=%d\n", pipename,rc,0 ); PRMSG(1, "\tProbable cause: there is already another XServer running on display :%s\n",port,0,0 ); DosClose(hfd); - xfree(ciptr); + free(ciptr); return(NULL); } @@ -307,7 +307,7 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol, { PRMSG(1, "Os2OpenServer: Unable to connect to pipe %s\n", pipename,0,0 ); DosClose (hfd); - xfree(ciptr); + free(ciptr); return (NULL); } @@ -316,25 +316,25 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol, /*** Put in info ***/ namelen=sizeof(struct sockaddr); - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->addr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2OpenServer: Can't allocate space for the addr\n", 0, 0, 0); DosClose(hfd); - xfree(ciptr); + free(ciptr); return(NULL); } ciptr->addrlen = namelen; ((struct sockaddr *)ciptr->addr)->sa_family = AF_UNIX; strcpy (((struct sockaddr *)ciptr->addr)->sa_data, "local"); - if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2OpenServer: Can't allocate space for the addr\n", 0, 0, 0); DosClose(hfd); - xfree(ciptr->addr); - xfree(ciptr); + free(ciptr->addr); + free(ciptr); return(NULL); } @@ -351,9 +351,9 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol, if((ciptr->fd=_imphandle(hfd))<0){ DosClose(hfd); - xfree(ciptr->addr); - xfree(ciptr->peeraddr); - xfree(ciptr); + free(ciptr->addr); + free(ciptr->peeraddr); + free(ciptr); return(NULL); } PRMSG(5, "Os2OpenServer: Pipe handle %d EMX handle %d",ciptr->index,ciptr->fd,0 ); @@ -365,9 +365,9 @@ TRANS(Os2OpenServer)(Xtransport *thistrans, char *protocol, PRMSG(1, "Os2OpenCOTSServer: Could not attach sem %d to pipe %d, rc=%d\n", hPipeSem,ciptr->fd,rc); DosClose(ciptr->fd); - xfree(ciptr->addr); - xfree(ciptr->peeraddr); - xfree(ciptr); + free(ciptr->addr); + free(ciptr->peeraddr); + free(ciptr); return(NULL); } #endif @@ -432,30 +432,30 @@ TRANS(Os2ReopenCOTSServer)(Xtransport *thistrans, int fd, char *port) PRMSG(2,"Os2ReopenCOTSServer(%d,%s)\n", fd, port, 0); - if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL ) + if( (ciptr=(XtransConnInfo)calloc(1,sizeof(struct _XtransConnInfo))) == NULL ) { - PRMSG(1,"Os2ReopenCOTSServer: xcalloc(1,%d) failed\n", + PRMSG(1,"Os2ReopenCOTSServer: calloc(1,%d) failed\n", sizeof(struct _XtransConnInfo),0,0 ); return NULL; } strcpy(addr_name,"local"); namelen=sizeof(addr_name); - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->addr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2ReopenCOTSServer: Can't allocate space for the addr\n", 0, 0, 0); - xfree(ciptr); + free(ciptr); return(NULL); } ciptr->addrlen = namelen; memcpy (ciptr->addr, addr_name, ciptr->addrlen); - if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2ReopenCOTSServer: Can't allocate space for the addr\n", 0, 0, 0); - xfree(ciptr); + free(ciptr); return(NULL); } @@ -508,9 +508,9 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) PRMSG(2,"Os2Accept(%x->%d)\n", ciptr, ciptr->fd,0); - if( (newciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo)))==NULL ) + if( (newciptr=(XtransConnInfo)calloc(1,sizeof(struct _XtransConnInfo)))==NULL ) { - PRMSG(1,"Os2Accept: xcalloc(1,%d) failed\n", + PRMSG(1,"Os2Accept: calloc(1,%d) failed\n", sizeof(struct _XtransConnInfo),0,0 ); *status = TRANS_ACCEPT_BAD_MALLOC; return NULL; @@ -521,7 +521,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) PRMSG(2,"Os2Accept: Error reading incoming connection, in=%d, error=%d\n", in,errno,0 ); *status = TRANS_ACCEPT_MISC_ERROR; - xfree(newciptr); + free(newciptr); rc = DosDisConnectNPipe(ciptr->fd); rc = DosConnectNPipe (ciptr->fd); if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED) @@ -540,7 +540,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) PRMSG(2,"Os2Accept: Error reading incoming connection, in=%d, error=%d\n", in,errno,0 ); *status = TRANS_ACCEPT_MISC_ERROR; - xfree(newciptr); + free(newciptr); rc = DosDisConnectNPipe(ciptr->fd); rc = DosConnectNPipe (ciptr->fd); if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED) @@ -566,7 +566,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) PRMSG(1,"Os2Accept: Open pipe %s to client failed, rc=%d\n", clientname,rc,0 ); PRMSG(1, "\tProbable cause: the client has exited or timed-out.\n",0,0,0 ); - xfree(newciptr); + free(newciptr); rc = DosDisConnectNPipe(ciptr->fd); rc = DosConnectNPipe (ciptr->fd); if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED) @@ -581,7 +581,7 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) { PRMSG(1,"Os2Accept: Could not set pipe %s to non-blocking mode, rc=%d\n", hClient,rc,0 ); - xfree(newciptr); + free(newciptr); rc = DosDisConnectNPipe(ciptr->fd); rc = DosConnectNPipe (ciptr->fd); if (rc != 0 && rc != ERROR_PIPE_NOT_CONNECTED) @@ -605,12 +605,12 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) /* And finally fill-in info in newciptr */ namelen=sizeof(struct sockaddr); - if ((newciptr->addr = (char *) xalloc (namelen)) == NULL) + if ((newciptr->addr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2Accept: Can't allocate space for the addr\n", 0, 0, 0); DosClose(hClient); - xfree(newciptr); + free(newciptr); return(NULL); } @@ -618,13 +618,13 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) ((struct sockaddr *)newciptr->addr)->sa_family = AF_UNIX; strcpy (((struct sockaddr *)newciptr->addr)->sa_data, "local"); - if ((newciptr->peeraddr = (char *) xalloc (namelen)) == NULL) + if ((newciptr->peeraddr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "Os2Accept: Can't allocate space for the addr\n", 0, 0, 0); DosClose(hClient); - xfree(ciptr->addr); - xfree(newciptr); + free(ciptr->addr); + free(newciptr); return(NULL); } @@ -643,9 +643,9 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) hClient,errno,0 ); PRMSG(1, "\tProbable cause: EMX has run out of file handles.\n",0,0,0 ); DosClose(hClient); - xfree(newciptr->addr); - xfree(newciptr->peeraddr); - xfree(newciptr); + free(newciptr->addr); + free(newciptr->peeraddr); + free(newciptr); return(NULL); } PRMSG(5, "Os2Accept: Pipe handle %d EMX handle %d",newciptr->index,newciptr->fd,0 ); @@ -657,9 +657,9 @@ TRANS(Os2Accept)(XtransConnInfo ciptr, int *status) PRMSG(1, "Os2OpenCOTSServer: Could not attach sem %d to pipe %d, rc=%d\n", hPipeSem,newciptr->fd,rc); DosClose(newciptr->fd); - xfree(newciptr->addr); - xfree(newciptr->peeraddr); - xfree(newciptr); + free(newciptr->addr); + free(newciptr->peeraddr); + free(newciptr); return(NULL); } #endif diff --git a/nx-X11/lib/xtrans/Xtranssock.c b/nx-X11/lib/xtrans/Xtranssock.c index 5c57fc5ba..e27ba9993 100644 --- a/nx-X11/lib/xtrans/Xtranssock.c +++ b/nx-X11/lib/xtrans/Xtranssock.c @@ -601,7 +601,7 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) () fprintf(stderr, "SocketCreateConnInfo: Going to create the NX connection info.\n"); #endif - if ((ciptr = (XtransConnInfo) xcalloc (1, sizeof(struct _XtransConnInfo))) == NULL) + if ((ciptr = (XtransConnInfo) calloc (1, sizeof(struct _XtransConnInfo))) == NULL) { PRMSG (1, "SocketCreateConnInfo: malloc failed\n", 0, 0, 0); return NULL; @@ -619,7 +619,7 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) () if (socketpair(PF_LOCAL, SOCK_STREAM, 0, fds) < 0) { PRMSG (1, "SocketCreateConnInfo: socketpair() failed.\n", 0, 0, 0); - xfree ((char *) ciptr); + free ((char *) ciptr); return NULL; } @@ -643,7 +643,7 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) () { PRMSG (1, "SocketCreateConnInfo: No space for a new _NXProxyConnInfo for [%d].\n", ciptr->fd, 0, 0); - xfree ((char *) ciptr); + free ((char *) ciptr); return NULL; } else if (_NXProxyConnInfoTab[ciptr->fd] != NULL) @@ -653,12 +653,12 @@ static XtransConnInfo TRANS(SocketCreateConnInfo) () exit(1); } - _NXProxyConnInfoTab[ciptr->fd] = (_NXProxyConnInfo *) xcalloc(1, sizeof(_NXProxyConnInfo)); + _NXProxyConnInfoTab[ciptr->fd] = (_NXProxyConnInfo *) calloc(1, sizeof(_NXProxyConnInfo)); if (_NXProxyConnInfoTab[ciptr->fd] == NULL) { PRMSG (1, "SocketCreateConnInfo: Alloc of _NXProxyConnInfo failed.\n", 0, 0, 0); - xfree ((char *) ciptr); + free ((char *) ciptr); return NULL; } @@ -812,7 +812,7 @@ static void TRANS(SocketCloseConnInfo) (XtransConnInfo ciptr) ciptr->fd); #endif - xfree((char *) _NXProxyConnInfoTab[ciptr->fd]); + free((char *) _NXProxyConnInfoTab[ciptr->fd]); _NXProxyConnInfoTab[ciptr->fd] = NULL; @@ -957,7 +957,7 @@ TRANS(SocketINETGetAddr) (XtransConnInfo ciptr) * Everything looks good: fill in the XtransConnInfo structure. */ - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->addr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "SocketINETGetAddr: Can't allocate space for the addr\n", @@ -1032,7 +1032,7 @@ TRANS(SocketINETGetPeerAddr) (XtransConnInfo ciptr) * Everything looks good: fill in the XtransConnInfo structure. */ - if ((ciptr->peeraddr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->peeraddr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "SocketINETGetPeerAddr: Can't allocate space for the addr\n", @@ -1063,7 +1063,7 @@ TRANS(SocketOpen) (int i, int type) return NULL; #endif - if ((ciptr = (XtransConnInfo) xcalloc ( + if ((ciptr = (XtransConnInfo) calloc ( 1, sizeof(struct _XtransConnInfo))) == NULL) { PRMSG (1, "SocketOpen: malloc failed\n", 0, 0, 0); @@ -1084,7 +1084,7 @@ TRANS(SocketOpen) (int i, int type) PRMSG (2, "SocketOpen: socket() failed for %s\n", Sockettrans2devtab[i].transname, 0, 0); - xfree ((char *) ciptr); + free ((char *) ciptr); return NULL; } @@ -1119,7 +1119,7 @@ TRANS(SocketReopen) (int i, int type, int fd, char *port) PRMSG (3,"SocketReopen(%d,%d,%s)\n", type, fd, port); - if ((ciptr = (XtransConnInfo) xcalloc ( + if ((ciptr = (XtransConnInfo) calloc ( 1, sizeof(struct _XtransConnInfo))) == NULL) { PRMSG (1, "SocketReopen: malloc failed\n", 0, 0, 0); @@ -1834,7 +1834,7 @@ TRANS(SocketUNIXCreateListener) (XtransConnInfo ciptr, char *port, namelen = sizeof (sockname); /* this will always make it the same size */ - if ((ciptr->addr = (char *) xalloc (namelen)) == NULL) + if ((ciptr->addr = (char *) malloc (namelen)) == NULL) { PRMSG (1, "SocketUNIXCreateListener: Can't allocate space for the addr\n", @@ -1953,7 +1953,7 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status) PRMSG (2, "SocketINETAccept(%p,%d)\n", ciptr, ciptr->fd, 0); - if ((newciptr = (XtransConnInfo) xcalloc ( + if ((newciptr = (XtransConnInfo) calloc ( 1, sizeof(struct _XtransConnInfo))) == NULL) { PRMSG (1, "SocketINETAccept: malloc failed\n", 0, 0, 0); @@ -1968,7 +1968,7 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status) errno = WSAGetLastError(); #endif PRMSG (1, "SocketINETAccept: accept() failed\n", 0, 0, 0); - xfree (newciptr); + free (newciptr); *status = TRANS_ACCEPT_FAILED; return NULL; } @@ -1996,7 +1996,7 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status) "SocketINETAccept: ...SocketINETGetAddr() failed:\n", 0, 0, 0); close (newciptr->fd); - xfree (newciptr); + free (newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } @@ -2007,8 +2007,8 @@ TRANS(SocketINETAccept) (XtransConnInfo ciptr, int *status) "SocketINETAccept: ...SocketINETGetPeerAddr() failed:\n", 0, 0, 0); close (newciptr->fd); - if (newciptr->addr) xfree (newciptr->addr); - xfree (newciptr); + if (newciptr->addr) free (newciptr->addr); + free (newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } @@ -2036,7 +2036,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) PRMSG (2, "SocketUNIXAccept(%p,%d)\n", ciptr, ciptr->fd, 0); - if ((newciptr = (XtransConnInfo) xcalloc ( + if ((newciptr = (XtransConnInfo) calloc ( 1, sizeof(struct _XtransConnInfo))) == NULL) { PRMSG (1, "SocketUNIXAccept: malloc() failed\n", 0, 0, 0); @@ -2048,7 +2048,7 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) (struct sockaddr *) &sockname, (void *)&namelen)) < 0) { PRMSG (1, "SocketUNIXAccept: accept() failed\n", 0, 0, 0); - xfree (newciptr); + free (newciptr); *status = TRANS_ACCEPT_FAILED; return NULL; } @@ -2058,13 +2058,13 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) * since this is unix domain. */ - if ((newciptr->addr = (char *) xalloc (ciptr->addrlen)) == NULL) + if ((newciptr->addr = (char *) malloc (ciptr->addrlen)) == NULL) { PRMSG (1, "SocketUNIXAccept: Can't allocate space for the addr\n", 0, 0, 0); close (newciptr->fd); - xfree (newciptr); + free (newciptr); *status = TRANS_ACCEPT_BAD_MALLOC; return NULL; } @@ -2078,14 +2078,14 @@ TRANS(SocketUNIXAccept) (XtransConnInfo ciptr, int *status) newciptr->addrlen = ciptr->addrlen; memcpy (newciptr->addr, ciptr->addr, newciptr->addrlen); - if ((newciptr->peeraddr = (char *) xalloc (ciptr->addrlen)) == NULL) + if ((newciptr->peeraddr = (char *) malloc (ciptr->addrlen)) == NULL) { PRMSG (1, "SocketUNIXAccept: Can't allocate space for the addr\n", 0, 0, 0); close (newciptr->fd); - if (newciptr->addr) xfree (newciptr->addr); - xfree (newciptr); + if (newciptr->addr) free (newciptr->addr); + free (newciptr); *status = TRANS_ACCEPT_BAD_MALLOC; return NULL; } @@ -2263,7 +2263,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port) " socketfor IPv4 address\n", 0,0,0); } if (newciptr) - xfree(newciptr); + free(newciptr); } else { socketaddr = NULL; PRMSG (4,"SocketINETConnect Skipping IPv4 address\n", @@ -2301,7 +2301,7 @@ TRANS(SocketINETConnect) (XtransConnInfo ciptr, char *host, char *port) "socket for IPv6 address\n", 0,0,0); } if (newciptr) - xfree(newciptr); + free(newciptr); } else { @@ -2827,8 +2827,8 @@ SocketUNIXConnectPost: * since this is unix domain. */ - if ((ciptr->addr = (char *) xalloc(namelen)) == NULL || - (ciptr->peeraddr = (char *) xalloc(namelen)) == NULL) + if ((ciptr->addr = (char *) malloc(namelen)) == NULL || + (ciptr->peeraddr = (char *) malloc(namelen)) == NULL) { PRMSG (1, "SocketUNIXCreateListener: Can't allocate space for the addr\n", diff --git a/nx-X11/lib/xtrans/Xtranstli.c b/nx-X11/lib/xtrans/Xtranstli.c index d8b5db83b..cab8da79f 100644 --- a/nx-X11/lib/xtrans/Xtranstli.c +++ b/nx-X11/lib/xtrans/Xtranstli.c @@ -171,9 +171,9 @@ TRANS(TLIGetAddr)(XtransConnInfo ciptr) */ if( ciptr->addr ) - xfree(ciptr->addr); + free(ciptr->addr); - if( (ciptr->addr=(char *)xalloc(netbuf.len)) == NULL ) + if( (ciptr->addr=(char *)malloc(netbuf.len)) == NULL ) { PRMSG(1, "TLIGetAddr: Can't allocate space for the addr\n", 0,0,0); @@ -221,9 +221,9 @@ TRANS(TLIGetPeerAddr)(XtransConnInfo ciptr) */ if( ciptr->peeraddr ) - xfree(ciptr->peeraddr); + free(ciptr->peeraddr); - if( (ciptr->peeraddr=(char *)xalloc(netbuf.len)) == NULL ) + if( (ciptr->peeraddr=(char *)malloc(netbuf.len)) == NULL ) { PRMSG(1, "TLIGetPeerAddr: Can't allocate space for the addr\n", @@ -320,7 +320,7 @@ TRANS(TLIOpen)(char *device) PRMSG(3,"TLIOpen(%s)\n", device, 0,0 ); - if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL ) + if( (ciptr=(XtransConnInfo)calloc(1,sizeof(struct _XtransConnInfo))) == NULL ) { PRMSG(1, "TLIOpen: calloc failed\n", 0,0,0 ); return NULL; @@ -353,7 +353,7 @@ TRANS(TLIReopen)(char *device, int fd, char *port) return NULL; } - if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL ) + if( (ciptr=(XtransConnInfo)calloc(1,sizeof(struct _XtransConnInfo))) == NULL ) { PRMSG(1, "TLIReopen: calloc failed\n", 0,0,0 ); return NULL; @@ -457,7 +457,7 @@ TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol, "TLIOpenCOTSClient: ...TLITLIBindLocal() failed: %d\n", errno, 0,0 ); t_close(ciptr->fd); - xfree(ciptr); + free(ciptr); return NULL; } @@ -467,7 +467,7 @@ TRANS(TLIOpenCOTSClient)(Xtransport *thistrans, char *protocol, "TLIOpenCOTSClient: ...TLIGetAddr() failed: %d\n", errno, 0,0 ); t_close(ciptr->fd); - xfree(ciptr); + free(ciptr); return NULL; } @@ -557,7 +557,7 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol, "TLIOpenCLTSClient: ...TLITLIBindLocal() failed: %d\n", errno, 0,0 ); t_close(ciptr->fd); - xfree(ciptr); + free(ciptr); return NULL; } @@ -567,7 +567,7 @@ TRANS(TLIOpenCLTSClient)(Xtransport *thistrans, char *protocol, "TLIOpenCLTSClient: ...TLIGetPeerAddr() failed: %d\n", errno, 0,0 ); t_close(ciptr->fd); - xfree(ciptr); + free(ciptr); return NULL; } @@ -730,7 +730,7 @@ TRANS(TLICreateListener)(XtransConnInfo ciptr, struct t_bind *req) * Everything looks good: fill in the XtransConnInfo structure. */ - if( (ciptr->addr=(char *)xalloc(ret->addr.len)) == NULL ) + if( (ciptr->addr=(char *)malloc(ret->addr.len)) == NULL ) { PRMSG(1, "TLICreateListener: Unable to allocate space for the address\n", @@ -917,7 +917,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status) errno, 0,0 ); t_free((char *)call,T_CALL); t_close(newciptr->fd); - xfree(newciptr); + free(newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } @@ -961,7 +961,7 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status) "TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n", errno, 0,0 ); t_close(newciptr->fd); - xfree(newciptr); + free(newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } @@ -972,8 +972,8 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status) "TLIAccept: TRANS(TLIGetPeerAddr)() failed: %d\n", errno, 0,0 ); t_close(newciptr->fd); - xfree(newciptr->addr); - xfree(newciptr); + free(newciptr->addr); + free(newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } @@ -983,8 +983,8 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status) PRMSG(1, "TLIAccept() ioctl(I_POP, \"timod\") failed %d\n", errno,0,0 ); t_close(newciptr->fd); - xfree(newciptr->addr); - xfree(newciptr); + free(newciptr->addr); + free(newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } @@ -994,8 +994,8 @@ TRANS(TLIAccept)(XtransConnInfo ciptr, int *status) PRMSG(1, "TLIAccept() ioctl(I_PUSH,\"tirdwr\") failed %d\n", errno,0,0 ); t_close(newciptr->fd); - xfree(newciptr->addr); - xfree(newciptr); + free(newciptr->addr); + free(newciptr); *status = TRANS_ACCEPT_MISC_ERROR; return NULL; } diff --git a/nx-X11/lib/xtrans/Xtransutil.c b/nx-X11/lib/xtrans/Xtransutil.c index 20e431ac8..cfe925edf 100644 --- a/nx-X11/lib/xtrans/Xtransutil.c +++ b/nx-X11/lib/xtrans/Xtransutil.c @@ -211,11 +211,11 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) if (len > 0) { if (*addrp && *addrlenp < (len + 1)) { - xfree ((char *) *addrp); + free ((char *) *addrp); *addrp = NULL; } if (!*addrp) - *addrp = (Xtransaddr *) xalloc (len + 1); + *addrp = (Xtransaddr *) malloc (len + 1); if (*addrp) { strcpy ((char *) *addrp, hostnamebuf); *addrlenp = len; @@ -226,7 +226,7 @@ TRANS(ConvertAddress)(int *familyp, int *addrlenp, Xtransaddr **addrp) else { if (*addrp) - xfree ((char *) *addrp); + free ((char *) *addrp); *addrp = NULL; *addrlenp = 0; } @@ -262,7 +262,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr) case AF_UNIX: { struct sockaddr_un *saddr = (struct sockaddr_un *) addr; - networkId = (char *) xalloc (3 + strlen (transName) + + networkId = (char *) malloc (3 + strlen (transName) + strlen (hostnamebuf) + strlen (saddr->sun_path)); sprintf (networkId, "%s/%s:%s", transName, hostnamebuf, saddr->sun_path); @@ -292,7 +292,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr) portnum = ntohs (saddr->sin_port); sprintf (portnumbuf, "%d", portnum); - networkId = (char *) xalloc (3 + strlen (transName) + + networkId = (char *) malloc (3 + strlen (transName) + strlen (hostnamebuf) + strlen (portnumbuf)); sprintf (networkId, "%s/%s:%s", transName, hostnamebuf, portnumbuf); break; @@ -304,7 +304,7 @@ TRANS(GetMyNetworkId) (XtransConnInfo ciptr) { struct sockaddr_dn *saddr = (struct sockaddr_dn *) addr; - networkId = (char *) xalloc ( + networkId = (char *) malloc ( 13 + strlen (hostnamebuf) + saddr->sdn_objnamel); sprintf (networkId, "dnet/%s::%s", hostnamebuf, saddr->sdn_objname); @@ -453,7 +453,7 @@ TRANS(GetPeerNetworkId) (XtransConnInfo ciptr) } - hostname = (char *) xalloc ( + hostname = (char *) malloc ( strlen (ciptr->transptr->TransName) + strlen (addr) + 2); strcpy (hostname, ciptr->transptr->TransName); strcat (hostname, "/"); diff --git a/nx-X11/lib/xtrans/transport.c b/nx-X11/lib/xtrans/transport.c index ff460c257..36de15e34 100644 --- a/nx-X11/lib/xtrans/transport.c +++ b/nx-X11/lib/xtrans/transport.c @@ -59,10 +59,6 @@ from The Open Group. #include "os.h" #else #include <stdlib.h> -#define xalloc(_size) malloc(_size) -#define xcalloc(_num,_size) calloc(_num,_size) -#define xrealloc(_ptr,_size) realloc(_ptr,_size) -#define xfree(_ptr) free(_ptr) #endif #include "Xtransint.h" |