summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorBenjamin Sugars <bsugars@canoe.ca>2001-03-26 08:29:54 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2001-03-26 18:44:32 +0000
commit571714202f6d2012220ed718d95c0404dd890ea5 (patch)
tree583f1bc96cd05d06fbc5939073065c049266e501 /pp_sys.c
parenta782ae34f4d6fddabf5ccada2e1bac94cd779cb4 (diff)
downloadperl-571714202f6d2012220ed718d95c0404dd890ea5.tar.gz
socket() leaks file descriptors
Message-ID: <Pine.LNX.4.21.0103261315510.2729-100000@marmot.rim.canoe.ca> Also sockpair() fixed similarly. p4raw-id: //depot/perl@9363
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 922fb2838e..d6266dc38c 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -2205,6 +2205,9 @@ PP(pp_socket)
RETPUSHUNDEF;
}
+ if (IoIFP(io))
+ do_close(gv, FALSE);
+
TAINT_PROPER("socket");
fd = PerlSock_socket(domain, type, protocol);
if (fd < 0)
@@ -2263,6 +2266,9 @@ PP(pp_sockpair)
RETPUSHUNDEF;
}
+ if (IoIFP(io))
+ do_close(gv, FALSE);
+
TAINT_PROPER("socketpair");
if (PerlSock_socketpair(domain, type, protocol, fd) < 0)
RETPUSHUNDEF;