Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r65225 - sandbox/SOC/2010/process/boost/process
From: boris_at_[hidden]
Date: 2010-09-03 16:29:09


Author: bschaeling
Date: 2010-09-03 16:29:06 EDT (Fri, 03 Sep 2010)
New Revision: 65225
URL: http://svn.boost.org/trac/boost/changeset/65225

Log:
Removed memory leak in create_child() on POSIX systems
Text files modified:
   sandbox/SOC/2010/process/boost/process/operations.hpp | 8 ++++++++
   1 files changed, 8 insertions(+), 0 deletions(-)

Modified: sandbox/SOC/2010/process/boost/process/operations.hpp
==============================================================================
--- sandbox/SOC/2010/process/boost/process/operations.hpp (original)
+++ sandbox/SOC/2010/process/boost/process/operations.hpp 2010-09-03 16:29:06 EDT (Fri, 03 Sep 2010)
@@ -313,6 +313,14 @@
     {
         BOOST_ASSERT(pid > 0);
 
+ for (std::size_t i = 0; i < argv.first; ++i)
+ delete[] argv.second[i];
+ delete[] argv.second;
+
+ for (std::size_t i = 0; i < envp.first; ++i)
+ delete[] envp.second[i];
+ delete[] envp.second;
+
         ctx.stdin_behavior->get_child_end().close();
         ctx.stdout_behavior->get_child_end().close();
         ctx.stderr_behavior->get_child_end().close();


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk