File tree Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Expand file tree Collapse file tree 1 file changed +1
-10
lines changed Original file line number Diff line number Diff line change @@ -182,20 +182,11 @@ piped_processt::piped_processt(const std::vector<std::string> commandvec)
182
182
unsigned long i = 0 ;
183
183
while (i < commandvec.size ())
184
184
{
185
- args[i] = strdup (commandvec[i].c_str ());
185
+ args[i] = const_cast < char *> (commandvec[i].c_str ());
186
186
i++;
187
187
}
188
188
args[i] = NULL ;
189
189
execvp (commandvec[0 ].c_str (), args);
190
- // The args variable will be handled by the OS if execvp succeeds, but
191
- // if execvp fails then we should free it here (just in case the runtime
192
- // error below continues execution.)
193
- while (i > 0 )
194
- {
195
- i--;
196
- free (args[i]);
197
- }
198
- free (args);
199
190
// Only reachable if execvp failed
200
191
std::cerr << " Launching " << commandvec[0 ]
201
192
<< " failed with error: " << strerror (errno) << std::endl;
You can’t perform that action at this time.
0 commit comments