]> granicus.if.org Git - php/commitdiff
plug memory leak on invalid result type
authorAntony Dovgal <tony2001@php.net>
Thu, 8 Nov 2007 13:28:38 +0000 (13:28 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 8 Nov 2007 13:28:38 +0000 (13:28 +0000)
ext/mysql/php_mysql.c

index b5511b625c657cf5ca77bd1e22d97bc7d5a99357..f823221cb7d13e373bbd3e8a3f42154ce2430187 100644 (file)
@@ -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);