In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/0c2c57a86cc6ec5688af5df66a8b8929f97ac491?hp=615a2e7f2463ed7fed1d6e1819306477ba1709d1>

- Log -----------------------------------------------------------------
commit 0c2c57a86cc6ec5688af5df66a8b8929f97ac491
Author: Daniel Dragan <[email protected]>
Date:   Mon May 19 19:45:41 2014 -0400

    remove intentional leak in win32/win32.c ansify_path
    
    The leak for was workaround for a bug (feature?) of Borland RTL where
    putenv kept the passed in pointer, see commit 3e5d884e5e .
    Borland was removed so this goes too. Leak found with Dr Memory.
    msvcrt.dll from WinXP SP3 does not leak on a call to putenv, static linked
    CRT from VC6 was confirmed to leak.
-----------------------------------------------------------------------

Summary of changes:
 pod/perldelta.pod | 6 ++++++
 win32/win32.c     | 8 +-------
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index 2760ad2..03ea866 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -465,6 +465,12 @@ index() and rindex() no longer crash when used on strings 
over 2GB in
 size.
 L<[perl #121562]|https://rt.perl.org/Ticket/Display.html?id=121562>.
 
+=item *
+
+A small previously intentional memory leak in PERL_SYS_INIT/PERL_SYS_INIT3 on
+Win32 builds was fixed. This might affect embedders who repeatedly create and
+destroy perl engines within the same process.
+
 =back
 
 =head1 Known Problems
diff --git a/win32/win32.c b/win32/win32.c
index 5a112ef..9126eec 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -4356,13 +4356,7 @@ ansify_path(void)
          * will not call mg_set() if it initializes %ENV from `environ`.
          */
         SetEnvironmentVariableA("PATH", ansi_path+5);
-        /* We are intentionally leaking the ansi_path string here because
-         * the some runtime libraries puts it directly into the environ
-         * array.  The Microsoft runtime library seems to make a copy,
-         * but will leak the copy should it be replaced again later.
-         * Since this code is only called once during PERL_SYS_INIT this
-         * shouldn't really matter.
-         */
+        win32_free(ansi_path);
     }
     win32_free(wide_path);
 }

--
Perl5 Master Repository

Reply via email to