Browse Source

strdup() can fail

experimental/5.2-WITH_DRCP
Ilia Alshanetsky 20 years ago
parent
commit
0763686034
  1. 3
      ext/standard/proc_open.c

3
ext/standard/proc_open.c

@ -784,6 +784,9 @@ PHP_FUNCTION(proc_open)
channel.errfd = -1;
/* Duplicate the command as processing downwards will modify it*/
command_dup = strdup(command);
if (!command_dup) {
goto exit_fail;
}
/* get a number of args */
construct_argc_argv(command_dup, NULL, &command_num_args, NULL);
child_argv = (char**) malloc((command_num_args + 1) * sizeof(char*));

Loading…
Cancel
Save