diff --git a/lib/base/process-unix.cpp b/lib/base/process-unix.cpp index 13052229f..7287963c5 100644 --- a/lib/base/process-unix.cpp +++ b/lib/base/process-unix.cpp @@ -184,8 +184,6 @@ void Process::Run(const boost::function& callback) #endif /* HAVE_PIPE2 */ // build argv - Log(LogDebug, "base", "Running command '" + boost::algorithm::join(m_Arguments, " ") + "'."); - char **argv = new char *[m_Arguments.size() + 1]; for (unsigned int i = 0; i < m_Arguments.size(); i++) @@ -193,8 +191,6 @@ void Process::Run(const boost::function& callback) argv[m_Arguments.size()] = NULL; - m_Arguments.clear(); - // build envp int envc = 0; @@ -262,6 +258,11 @@ void Process::Run(const boost::function& callback) // parent process + Log(LogDebug, "base", "Running command '" + boost::algorithm::join(m_Arguments, " ") + + "': PID " + Convert::ToString(m_Pid)); + + m_Arguments.clear(); + // free arguments for (int i = 0; argv[i] != NULL; i++) free(argv[i]);