From: Andrey Hristov Date: Wed, 30 Nov 2005 11:35:03 +0000 (+0000) Subject: fix a crash and a leak. X-Git-Tag: php-5.1.2RC1~298 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c230f7defb2752a3546a56e6243fe3b9cba99492;p=php fix a crash and a leak. 4.1.15 (client) -> 5.x (server) because of the incompatibility because of decimal in the protocol binding may fail. Don't close the statement in that case because subsequent ->execute() will crash or any other function that will try to use already freed (and in debug mode thrashed) pointer. #probably more problems exist because of the 4.1.x -> 5.x protocol #incompatibility --- diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index 8f6d778c01..9ade72bb8c 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -354,7 +354,9 @@ PHP_FUNCTION(mysqli_stmt_bind_result) if (rc) { efree(bind); efree(args); - php_clear_stmt_bind(stmt); + /* dont close the statement or subsequent usage (for example ->execute()) will lead to crash */ + efree(stmt->result.buf); + efree(stmt->result.is_null); RETURN_FALSE; }