svn: /pecl/mysqlnd_ms/trunk/ mysqlnd_ms.c

From: Date: Tue, 06 Dec 2011 18:25:11 +0000
Subject: svn: /pecl/mysqlnd_ms/trunk/ mysqlnd_ms.c
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-17274@lists.php.net to get a copy of this message
uw Tue, 06 Dec 2011 18:25:11 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=320516 Log: Move dtor call after copy of error_info to prevent crash when trying to access free'd error info. Crash has happened if status == FAIL because of failure to connect (to slave - in my case). Changed paths: U pecl/mysqlnd_ms/trunk/mysqlnd_ms.c Modified: pecl/mysqlnd_ms/trunk/mysqlnd_ms.c =================================================================== --- pecl/mysqlnd_ms/trunk/mysqlnd_ms.c 2011-12-06 18:21:57 UTC (rev 320515) +++ pecl/mysqlnd_ms/trunk/mysqlnd_ms.c 2011-12-06 18:25:11 UTC (rev 320516) @@ -521,11 +521,6 @@ enum_func_status status = mysqlnd_ms_connect_to_host_aux(proxy_conn, tmp_conn, current_subsection_name, is_master, host, conn_list, &cred, master_global_trx, lazy_connections, persistent TSRMLS_CC); -#if MYSQLND_VERSION_ID >= 50010 - if (tmp_conn_handle) { - tmp_conn_handle->m->dtor(tmp_conn_handle TSRMLS_CC); - } -#endif if (status != PASS) { php_error_docref(NULL TSRMLS_CC, E_WARNING, MYSQLND_MS_ERROR_PREFIX " Cannot connect to %s", host); (*error_info) = MYSQLND_MS_ERROR_INFO(tmp_conn); @@ -544,6 +539,12 @@ MYSQLND_MS_INC_STATISTIC(success_stat); } } +#if MYSQLND_VERSION_ID >= 50010 + if (tmp_conn_handle) { + tmp_conn_handle->m->dtor(tmp_conn_handle TSRMLS_CC); + } +#endif + } else { failures++; /* Handle OOM!! */

« previous php.pecl.cvs (#17274) next »