summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
Diffstat (limited to 'ace')
-rw-r--r--ace/Process_Manager.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/ace/Process_Manager.cpp b/ace/Process_Manager.cpp
index dfd91fbe852..208c3234e6c 100644
--- a/ace/Process_Manager.cpp
+++ b/ace/Process_Manager.cpp
@@ -409,7 +409,11 @@ ACE_Process_Manager::spawn (ACE_Process_Options &options)
ACE_Managed_Process,
ACE_INVALID_PID);
- return spawn (process, options);
+ pid_t pid = spawn (process, options);
+ if (pid == ACE_INVALID_PID || pid == 0)
+ delete process;
+
+ return pid;
}
// Create a new process.