aboutsummaryrefslogtreecommitdiff
path: root/X11/xtrans/Xtranslcl.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2011-12-12 12:23:04 +0100
committermarha <marha@users.sourceforge.net>2011-12-12 12:23:04 +0100
commit5efb0a5e19b75137b7294b27f4e7878aeb8f0927 (patch)
treea8138a3cf2f3ed5beacd1ce9e44dda79b51f9ffd /X11/xtrans/Xtranslcl.c
parent5b178ff5a5f0b6e481cf9fd9749eb7ef9581c987 (diff)
downloadvcxsrv-5efb0a5e19b75137b7294b27f4e7878aeb8f0927.tar.gz
vcxsrv-5efb0a5e19b75137b7294b27f4e7878aeb8f0927.tar.bz2
vcxsrv-5efb0a5e19b75137b7294b27f4e7878aeb8f0927.zip
libxtrans libX11 libxcb xserver mesa git update 12 dec 2011
Diffstat (limited to 'X11/xtrans/Xtranslcl.c')
-rw-r--r--X11/xtrans/Xtranslcl.c55
1 files changed, 25 insertions, 30 deletions
diff --git a/X11/xtrans/Xtranslcl.c b/X11/xtrans/Xtranslcl.c
index 8466ddc4c..5beef7c98 100644
--- a/X11/xtrans/Xtranslcl.c
+++ b/X11/xtrans/Xtranslcl.c
@@ -152,7 +152,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 = malloc (ciptr->addrlen)) == NULL)
{
prmsg(1,"FillAddrInfo: failed to allocate memory for addr\n");
return 0;
@@ -162,7 +162,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
if (strlen(sun_path) > sizeof(sunaddr->sun_path) - 1) {
prmsg(1, "FillAddrInfo: path too long\n");
- xfree((char *) sunaddr);
+ free((char *) sunaddr);
return 0;
}
strcpy (sunaddr->sun_path, sun_path);
@@ -174,12 +174,11 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
ciptr->peeraddrlen = sizeof (struct sockaddr_un);
- if ((p_sunaddr = (struct sockaddr_un *) xalloc (
- ciptr->peeraddrlen)) == NULL)
+ if ((p_sunaddr = malloc (ciptr->peeraddrlen)) == NULL)
{
prmsg(1,
"FillAddrInfo: failed to allocate memory for peer addr\n");
- xfree ((char *) sunaddr);
+ free (sunaddr);
ciptr->addr = NULL;
return 0;
@@ -189,7 +188,7 @@ TRANS(FillAddrInfo)(XtransConnInfo ciptr, char *sun_path, char *peer_sun_path)
if (strlen(peer_sun_path) > sizeof(p_sunaddr->sun_path) - 1) {
prmsg(1, "FillAddrInfo: peer path too long\n");
- xfree((char *) p_sunaddr);
+ free((char *) p_sunaddr);
return 0;
}
strcpy (p_sunaddr->sun_path, peer_sun_path);
@@ -613,7 +612,7 @@ TRANS(PTSAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
*/
newciptr->addrlen=ciptr->addrlen;
- if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) {
+ if( (newciptr->addr = malloc(newciptr->addrlen)) == NULL ) {
prmsg(1,"PTSAccept: failed to allocate memory for peer addr\n");
close(newfd);
*status = TRANS_ACCEPT_BAD_MALLOC;
@@ -623,9 +622,9 @@ 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 = malloc(newciptr->peeraddrlen)) == NULL ) {
prmsg(1,"PTSAccept: failed to allocate memory for peer addr\n");
- xfree(newciptr->addr);
+ free(newciptr->addr);
close(newfd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
@@ -885,7 +884,7 @@ TRANS(NAMEDAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
*/
newciptr->family=ciptr->family;
newciptr->addrlen=ciptr->addrlen;
- if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) {
+ if( (newciptr->addr = malloc(newciptr->addrlen)) == NULL ) {
prmsg(1,
"NAMEDAccept: failed to allocate memory for pipe addr\n");
close(str.fd);
@@ -896,10 +895,10 @@ 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 = malloc(newciptr->peeraddrlen)) == NULL ) {
prmsg(1,
"NAMEDAccept: failed to allocate memory for peer addr\n");
- xfree(newciptr->addr);
+ free(newciptr->addr);
close(str.fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
@@ -1223,7 +1222,7 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
*/
newciptr->addrlen=ciptr->addrlen;
- if( (newciptr->addr=(char *)xalloc(newciptr->addrlen)) == NULL ) {
+ if( (newciptr->addr = malloc(newciptr->addrlen)) == NULL ) {
prmsg(1,
"SCOAccept: failed to allocate memory for peer addr\n");
close(fd);
@@ -1237,10 +1236,10 @@ TRANS(SCOAccept)(XtransConnInfo ciptr, XtransConnInfo newciptr, int *status)
#endif
newciptr->peeraddrlen=newciptr->addrlen;
- if( (newciptr->peeraddr=(char *)xalloc(newciptr->peeraddrlen)) == NULL ) {
+ if( (newciptr->peeraddr = malloc(newciptr->peeraddrlen)) == NULL ) {
prmsg(1,
"SCOAccept: failed to allocate memory for peer addr\n");
- xfree(newciptr->addr);
+ free(newciptr->addr);
close(fd);
*status = TRANS_ACCEPT_BAD_MALLOC;
return -1;
@@ -1671,17 +1670,13 @@ TRANS(LocalInitTransports)(const char *protocol)
if( strcmp(protocol,"local") && strcmp(protocol,"LOCAL") )
{
- workingXLOCAL=freeXLOCAL=(char *)xalloc (strlen (protocol) + 1);
- if (workingXLOCAL)
- strcpy (workingXLOCAL, protocol);
+ workingXLOCAL = freeXLOCAL = strdup (protocol);
}
else {
XLOCAL=(char *)getenv("XLOCAL");
if(XLOCAL==NULL)
XLOCAL=DEF_XLOCAL;
- workingXLOCAL=freeXLOCAL=(char *)xalloc (strlen (XLOCAL) + 1);
- if (workingXLOCAL)
- strcpy (workingXLOCAL, XLOCAL);
+ workingXLOCAL = freeXLOCAL = strdup (XLOCAL);
}
}
@@ -1690,7 +1685,7 @@ TRANS(LocalEndTransports)(void)
{
prmsg(3,"LocalEndTransports()\n");
- xfree(freeXLOCAL);
+ free(freeXLOCAL);
}
#define TYPEBUFSIZE 32
@@ -1815,7 +1810,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 = calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
prmsg(1,"LocalOpenClient: calloc(1,%lu) failed\n",
sizeof(struct _XtransConnInfo));
@@ -1856,7 +1851,7 @@ TRANS(LocalOpenClient)(int type, char *protocol, char *host, char *port)
if( ciptr->fd < 0 )
{
- xfree(ciptr);
+ free(ciptr);
return NULL;
}
@@ -1889,7 +1884,7 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host _X_UNUSED, char *por
*/
#endif /* X11_t */
- if( (ciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo))) == NULL )
+ if( (ciptr = calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
prmsg(1,"LocalOpenServer: calloc(1,%lu) failed\n",
sizeof(struct _XtransConnInfo));
@@ -1925,7 +1920,7 @@ TRANS(LocalOpenServer)(int type, char *protocol, char *host _X_UNUSED, char *por
}
}
- xfree(ciptr);
+ free(ciptr);
return NULL;
}
@@ -1943,7 +1938,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 = calloc(1,sizeof(struct _XtransConnInfo))) == NULL )
{
prmsg(1,"LocalReopenServer: calloc(1,%lu) failed\n",
sizeof(struct _XtransConnInfo));
@@ -1972,7 +1967,7 @@ TRANS(LocalReopenServer)(int type, int index, int fd, char *port)
return ciptr;
}
- xfree(ciptr);
+ free(ciptr);
return NULL;
}
@@ -2175,7 +2170,7 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status)
transptr=(LOCALtrans2dev *)ciptr->priv;
- if( (newciptr=(XtransConnInfo)xcalloc(1,sizeof(struct _XtransConnInfo)))==NULL )
+ if( (newciptr = calloc(1,sizeof(struct _XtransConnInfo)))==NULL )
{
prmsg(1,"LocalAccept: calloc(1,%lu) failed\n",
sizeof(struct _XtransConnInfo));
@@ -2187,7 +2182,7 @@ TRANS(LocalAccept)(XtransConnInfo ciptr, int *status)
if( newciptr->fd < 0 )
{
- xfree(newciptr);
+ free(newciptr);
return NULL;
}