aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/include
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/lib/include')
-rw-r--r--nx-X11/lib/include/xtrans/Xtrans.c13
-rw-r--r--nx-X11/lib/include/xtrans/Xtranssock.c5
2 files changed, 9 insertions, 9 deletions
diff --git a/nx-X11/lib/include/xtrans/Xtrans.c b/nx-X11/lib/include/xtrans/Xtrans.c
index 328a970b1..033dd6cd7 100644
--- a/nx-X11/lib/include/xtrans/Xtrans.c
+++ b/nx-X11/lib/include/xtrans/Xtrans.c
@@ -980,16 +980,17 @@ TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
{
prmsg (1,"GetMyAddr: malloc failed\n");
return -1;
+ } else {
+ memcpy(*addrp, ciptr->addr, ciptr->addrlen);
+ free(addrp);
}
- memcpy(*addrp, ciptr->addr, ciptr->addrlen);
-
return 0;
}
#endif
int
TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
- Xtransaddr **addrp)
+ Xtransaddr **addrp)
{
prmsg (2,"GetPeerAddr(%d)\n", ciptr->fd);
@@ -999,11 +1000,11 @@ TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp,
if ((*addrp = malloc (ciptr->peeraddrlen)) == NULL)
{
- prmsg (1,"GetPeerAddr: malloc failed\n");
- return -1;
+ prmsg (1,"GetPeerAddr: malloc failed\n");
+ return -1;
}
memcpy(*addrp, ciptr->peeraddr, ciptr->peeraddrlen);
-
+ free(addrp);
return 0;
}
diff --git a/nx-X11/lib/include/xtrans/Xtranssock.c b/nx-X11/lib/include/xtrans/Xtranssock.c
index a7470edcd..090a325ce 100644
--- a/nx-X11/lib/include/xtrans/Xtranssock.c
+++ b/nx-X11/lib/include/xtrans/Xtranssock.c
@@ -2442,19 +2442,18 @@ SocketUNIXConnectPost:
(ciptr->peeraddr = malloc(namelen)) == NULL)
{
prmsg (1,
- "SocketUNIXCreateListener: Can't allocate space for the addr\n");
+ "SocketUNIXCreateListener: Can't allocate space for the addr\n");
return TRANS_CONNECT_FAILED;
}
if (abstract)
- sockname.sun_path[0] = '@';
+ sockname.sun_path[0] = '@';
ciptr->family = AF_UNIX;
ciptr->addrlen = namelen;
ciptr->peeraddrlen = namelen;
memcpy (ciptr->addr, &sockname, ciptr->addrlen);
memcpy (ciptr->peeraddr, &sockname, ciptr->peeraddrlen);
-
return 0;
}