From e35d4b7d0af7466a1e76ad26606ace7ec9c37081 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Sun, 4 Oct 2009 14:36:01 +0000 Subject: fixed bug @ new exec --- src/sysExec.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/sysExec.cpp b/src/sysExec.cpp index 9a397a2..ca62dfd 100644 --- a/src/sysExec.cpp +++ b/src/sysExec.cpp @@ -104,8 +104,7 @@ void anytun_exec(std::string const& script, StringVector const& args, StringList argv[i+1] = new char[args[i].size() + 1]; std::strcpy(argv[i+1], args[i].c_str()); } - argv[args.size() + 1] = new char[1]; - argv[args.size() + 1][0] = NULL; + argv[args.size() + 1] = NULL; char** evp; if(env.size()) { @@ -116,12 +115,10 @@ void anytun_exec(std::string const& script, StringVector const& args, StringList std::strcpy(evp[i], it->c_str()); ++i; } - evp[env.size()] = new char[1]; - evp[env.size()][0] = NULL; + evp[env.size()] = NULL; } else { evp = new char*[1]; - evp[0] = new char[1]; - evp[0][0] = NULL; + evp[0] = NULL; } execve(script.c_str(), argv, evp); -- cgit v1.2.3