mirror of
https://github.com/php/php-src.git
synced 2024-09-23 02:47:26 +00:00
Merge branch 'PHP-7.1'
* PHP-7.1: add error check and fix leak fix leak
This commit is contained in:
commit
646d3f66a3
@ -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;
|
||||
}
|
||||
|
@ -425,6 +425,7 @@ PW32IO wchar_t *php_win32_ioutil_getcwd_w(const wchar_t *buf, int len)
|
||||
if (!GetCurrentDirectoryW(len, buf)) {
|
||||
err = GetLastError();
|
||||
SET_ERRNO_FROM_WIN32_CODE(err);
|
||||
free(tmp_buf);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user