summaryrefslogtreecommitdiff
path: root/ext/standard/proc_open.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/standard/proc_open.c')
-rw-r--r--ext/standard/proc_open.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index d7d4839618..afd0ca240b 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -777,6 +777,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*));