mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
pdo_odbc: Fix memory leak if WideCharToMultiByte() fails
Closes GH-18788.
This commit is contained in:
3
NEWS
3
NEWS
@@ -34,6 +34,9 @@ PHP NEWS
|
||||
. Add missing filter cleanups on phar failure. (nielsdos)
|
||||
. Fixed bug GH-18642 (Signed integer overflow in ext/phar fseek). (nielsdos)
|
||||
|
||||
- PDO ODBC:
|
||||
. Fix memory leak if WideCharToMultiByte() fails. (nielsdos)
|
||||
|
||||
- PGSQL:
|
||||
. Fix warning not being emitted when failure to cancel a query with
|
||||
pg_cancel_query(). (Girgias)
|
||||
|
||||
@@ -104,6 +104,7 @@ static int pdo_odbc_ucs22utf8(pdo_stmt_t *stmt, int is_unicode, zval *result)
|
||||
zend_string *str = zend_string_alloc(ret, 0);
|
||||
ret = WideCharToMultiByte(CP_UTF8, 0, (LPCWSTR) Z_STRVAL_P(result), Z_STRLEN_P(result)/sizeof(WCHAR), ZSTR_VAL(str), ZSTR_LEN(str), NULL, NULL);
|
||||
if (ret == 0) {
|
||||
zend_string_efree(str);
|
||||
return PDO_ODBC_CONV_FAIL;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user