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
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
2 changed files with 4 additions and 0 deletions

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;
}