From a4d95c001f31b912d22d94c9c9efbe28899e1a8e Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Thu, 8 Nov 2007 13:28:38 +0000 Subject: [PATCH] plug memory leak on invalid result type --- ext/mysql/php_mysql.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ext/mysql/php_mysql.c b/ext/mysql/php_mysql.c index b5511b625c..f823221cb7 100644 --- a/ext/mysql/php_mysql.c +++ b/ext/mysql/php_mysql.c @@ -2056,6 +2056,7 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, int result_type, if ((result_type & MYSQL_BOTH) == 0) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "The result type should be either MYSQL_NUM, MYSQL_ASSOC or MYSQL_BOTH"); + result_type = MYSQL_BOTH; } ZEND_FETCH_RESOURCE(mysql_result, MYSQL_RES *, result, -1, "MySQL result", le_result); -- 2.50.1