summaryrefslogtreecommitdiff
path: root/ext/mysql/php_mysql.c
diff options
context:
space:
mode:
authorUlf Wendel <uw@php.net>2009-09-16 17:03:44 +0000
committerUlf Wendel <uw@php.net>2009-09-16 17:03:44 +0000
commite6cf6693e6e0d1d74641035cc6a5ca424db830b3 (patch)
tree2da01b5362b0486d4751bacd3b5d249f5e3b7ed7 /ext/mysql/php_mysql.c
parent20005db2a0469e5ca3ca0f8ed2277a9bea058529 (diff)
downloadphp-git-e6cf6693e6e0d1d74641035cc6a5ca424db830b3.tar.gz
Fix (by Andrey) and test for bug #49442 . Don't use efree() for memory allocated with malloc()... If a connection gets created by mysqli_init(), mysqlnd makes it 'persistent'. 'Persistent' means that mysqlnd uses malloc(). mysqlnd does use malloc() instead of ealloc() because it is unknown if the connection will become a true persistent connection in the sense of ext/mysqli. It is unknown if the user wants a persistent connection or not until the user calls mysqli_real_connect(). To avoid tricky conversions mysqlnd uses malloc(), which sets a private persistent flag in the mysqlnd structures. A precondition for the crash to happen was that the private persistent flag is set. The flag is also set when creating a real persistent connection (in the sense of ext/mysqli) and so the bug can happen with mysql_init()/mysqli_real_connect() and mysql_connect('p:<host>', ...). Therefore we test both cases. Note the (tricky?) difference between the implementation detail'mysqlnd private persistent flag = use malloc()' and persistent connections from a user perspective. Although mysqlnd will always set its private persistent flag and use malloc() for connections created with mysqli_init() it is still up to the user to decide in mysqli_real_connect() if the connection shall become a (true) persistent connection or not.
Diffstat (limited to 'ext/mysql/php_mysql.c')
0 files changed, 0 insertions, 0 deletions