]> granicus.if.org Git - php/commitdiff
fix a crash and a leak.
authorAndrey Hristov <andrey@php.net>
Wed, 30 Nov 2005 11:35:03 +0000 (11:35 +0000)
committerAndrey Hristov <andrey@php.net>
Wed, 30 Nov 2005 11:35:03 +0000 (11:35 +0000)
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

ext/mysqli/mysqli_api.c

index 8f6d778c0121b14ba03b187b3276784ad0aaa376..9ade72bb8cf903b6a939cc1ba2887153420a892d 100644 (file)
@@ -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;
        }