diff options
-rw-r--r-- | Xtranslcl.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Xtranslcl.c b/Xtranslcl.c index 8391156..cb5836c 100644 --- a/Xtranslcl.c +++ b/Xtranslcl.c @@ -163,6 +163,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", 0, 0, 0); + xfree((char *) sunaddr); return 0; } strcpy (sunaddr->sun_path, sun_path); @@ -190,6 +191,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", 0, 0, 0); + xfree((char *) p_sunaddr); return 0; } strcpy (p_sunaddr->sun_path, peer_sun_path); @@ -352,6 +354,7 @@ TRANS(PTSOpenClient)(XtransConnInfo ciptr, char *port) if ((fd = open(DEV_PTMX, O_RDWR)) < 0) { PRMSG(1,"PTSOpenClient: failed to open %s\n", DEV_PTMX, 0,0); + close(server); return(-1); } @@ -1126,6 +1129,10 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port) if ((fds = open(DEV_SPX, O_RDWR)) < 0 || (fdr = open(DEV_SPX, O_RDWR)) < 0 ) { PRMSG(1,"SCOOpenServer: failed to open %s\n", DEV_SPX, 0,0 ); + if (fds >= 0) + close(fds); + if (fdr >= 0) + close(fdr); return -1; } @@ -1165,7 +1172,7 @@ TRANS(SCOOpenServer)(XtransConnInfo ciptr, char *port) } fdr = open (serverR_path, O_RDWR | O_NDELAY); - if (fds < 0) { + if (fdr < 0) { PRMSG(1,"SCOOpenServer: failed to open %s\n", serverR_path, 0, 0); close (fds); return -1; |