From 0763686034c0b696802b28580a4487caa4934cdc Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Sat, 24 Feb 2007 03:24:40 +0000 Subject: [PATCH] strdup() can fail --- ext/standard/proc_open.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 15cea0d8363..26f4a6fc8a8 100644 --- a/ext/standard/proc_open.c +++ b/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*));