develooper Front page | perl.perl5.porters | Postings from August 2001

[patch] plug PL_sh_path leak

Thread Next
From:
Doug MacEachern
Date:
August 2, 2001 20:52
Subject:
[patch] plug PL_sh_path leak
Message ID:
Pine.LNX.4.21.0108022043040.8991-100000@mako.covalent.net
PL_sh_path is points to static memory (#define SH_PATH "/bin/sh") and is
never freed, so perl_clone should not copy it.  5.6.1 also has this leak.
i'll stop saying there's more still leaks and just say when there's no
more when that happens.

Index: sv.c
===================================================================
RCS file: /usr/local/cvs_repository/perl-current-mirror/sv.c,v
retrieving revision 1.1.1.69
diff -u -r1.1.1.69 sv.c
--- sv.c	2001/08/02 00:53:01	1.1.1.69
+++ sv.c	2001/08/03 03:50:30
@@ -9927,7 +9927,7 @@
     PL_origalen		= proto_perl->Iorigalen;
     PL_pidstatus	= newHV();			/* XXX flag for cloning? */
     PL_osname		= SAVEPV(proto_perl->Iosname);
-    PL_sh_path		= SAVEPV(proto_perl->Ish_path);
+    PL_sh_path		= proto_perl->Ish_path; /* XXX never deallocated */
     PL_sighandlerp	= proto_perl->Isighandlerp;
 
 


Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About