Chromium Code Reviews| Index: bin/process_linux.cc |
| =================================================================== |
| --- bin/process_linux.cc (revision 1523) |
| +++ bin/process_linux.cc (working copy) |
| @@ -189,7 +189,7 @@ |
| return errno; |
| } |
| - char* program_arguments[arguments_length + 2]; |
| + char** program_arguments = new char*[arguments_length + 2]; |
| program_arguments[0] = const_cast<char *>(path); |
| for (int i = 0; i < arguments_length; i++) { |
| program_arguments[i + 1] = arguments[i]; |
| @@ -206,6 +206,7 @@ |
| pid = fork(); |
| if (pid < 0) { |
| SetChildOsErrorMessage(os_error_message, os_error_message_len); |
| + delete program_arguments; |
|
tobyr
2011/11/15 17:41:16
Shouldn't this (and below) also be delete[]? Ditto
Ivan Posva
2011/11/15 17:47:02
Done.
|
| close(read_in[0]); |
| close(read_in[1]); |
| close(read_err[0]); |
| @@ -255,6 +256,9 @@ |
| exit(1); |
| } |
| + // The arguments for the spawned process are not needed any longer. |
| + delete program_arguments; |
| + |
| int event_fds[2]; |
| result = pipe(event_fds); |
| if (result < 0) { |