mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
add error check and fix leak
This commit is contained in:
parent
7ecfb4b954
commit
201f90a8cc
1 changed files with 5 additions and 0 deletions
|
@ -753,9 +753,14 @@ PHP_FUNCTION(proc_open)
|
|||
|
||||
len = (sizeof(COMSPEC_NT) + sizeof(" /c ") + tmp_len + 1);
|
||||
cmdw2 = (wchar_t *)malloc(len * sizeof(wchar_t));
|
||||
if (!cmdw2) {
|
||||
php_error_docref(NULL, E_WARNING, "Command conversion failed");
|
||||
goto exit_fail;
|
||||
}
|
||||
ret = _snwprintf(cmdw2, len, L"%hs /c %s", COMSPEC_NT, cmdw);
|
||||
|
||||
if (-1 == ret) {
|
||||
free(cmdw2);
|
||||
php_error_docref(NULL, E_WARNING, "Command conversion failed");
|
||||
goto exit_fail;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue