1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Fix memory leak on php_odbc_fetch_hash() failure

The array is initialized but not freed.

Closes GH-18787.
This commit is contained in:
Niels Dossche
2025-06-07 00:33:34 +02:00
parent 9a9d98e02f
commit ef92e06de1
2 changed files with 4 additions and 0 deletions

3
NEWS
View File

@@ -21,6 +21,9 @@ PHP NEWS
. Fix memory leak in intl_datetime_decompose() on failure. (nielsdos)
. Fix memory leak in locale lookup on failure. (nielsdos)
- ODBC:
. Fix memory leak on php_odbc_fetch_hash() failure. (nielsdos)
- OpenSSL:
. Fix memory leak of X509_STORE in php_openssl_setup_verify() on failure.
(nielsdos)

View File

@@ -1370,6 +1370,7 @@ static void php_odbc_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type)
if (rc == SQL_ERROR) {
odbc_sql_error(result->conn_ptr, result->stmt, "SQLGetData");
efree(buf);
zval_ptr_dtor(return_value);
RETURN_FALSE;
}