Skip to content

Commit d31b24f

Browse files
ext/standard/exec.c: combine conditions, update docs
While `php_escape_shell_cmd()` did indeed `emalloc` a string that needed to be freed by the caller in the original implementation that was put in GitHub (see commit 257de2b) a few months ago the return type was changed to use `zend_string`, see php#14353.
1 parent 0efe475 commit d31b24f

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

ext/standard/exec.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,6 @@ PHPAPI int php_exec(int type, const char *cmd, zval *array, zval *return_value)
119119
size_t buflen, bufl = 0;
120120
#if PHP_SIGCHILD
121121
void (*sig_handler)() = NULL;
122-
#endif
123-
124-
#if PHP_SIGCHILD
125122
sig_handler = signal (SIGCHLD, SIG_DFL);
126123
#endif
127124

@@ -272,8 +269,7 @@ PHP_FUNCTION(passthru)
272269
Escape all chars that could possibly be used to
273270
break out of a shell command
274271
275-
This function emalloc's a string and returns the pointer.
276-
Remember to efree it when done with it.
272+
This function allocates a new zend_string, remember to free it when done.
277273
278274
*NOT* safe for binary strings
279275
*/

0 commit comments

Comments
 (0)