From: Andrey Hristov Date: Tue, 11 May 2010 10:03:16 +0000 (+0000) Subject: Fix for bug #51605 (Mysqli zombie links) X-Git-Tag: php-5.3.3RC1~189 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=962aa93ec78493441a322630b70261d1b0a74e64;p=php Fix for bug #51605 (Mysqli zombie links) --- diff --git a/NEWS b/NEWS index 7108bd2959..052dd8f06f 100644 --- a/NEWS +++ b/NEWS @@ -67,6 +67,7 @@ PHP NEWS literal). (cbandy at jbandy dot com) - Fixed bug #51607 (pg_copy_from does not allow schema in the tablename argument). (cbandy at jbandy dot com) +- Fixed bug #51605 (Mysqli - zombie links). (Andrey) - Fixed bug #51604 (newline in end of header is shown in start of message). (Daniel Egeberg) - Fixed bug #51590 (JSON_ERROR_UTF8 is undefined). (Felipe) diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c index bd2cdcb0cf..e8f4d02467 100644 --- a/ext/mysqli/mysqli_api.c +++ b/ext/mysqli/mysqli_api.c @@ -562,13 +562,13 @@ void php_mysqli_close(MY_MYSQL * mysql, int close_type TSRMLS_DC) mysqli_plist_entry *plist = (mysqli_plist_entry *) le->ptr; zend_ptr_stack_push(&plist->free_links, mysql->mysql); - MyG(num_links)--; MyG(num_active_persistent)--; MyG(num_inactive_persistent)++; } } mysql->persistent = FALSE; } + MyG(num_links)--; mysql->mysql = NULL; php_clear_mysql(mysql); diff --git a/ext/mysqli/tests/bug51605.phpt b/ext/mysqli/tests/bug51605.phpt new file mode 100644 index 0000000000..d8e5c88afc --- /dev/null +++ b/ext/mysqli/tests/bug51605.phpt @@ -0,0 +1,36 @@ +--TEST-- +Bug #51647 (Certificate file without private key (pk in another file) doesn't work) +--SKIPIF-- + +--INI-- +mysqli.max_links = 1 +mysqli.allow_persistent = Off +mysqli.max_persistent = 0 +mysqli.reconnect = Off +--FILE-- + +--EXPECTF-- +closed once +closed twice +done!