From: Qianqian Bu Date: Fri, 3 Apr 2020 07:44:41 +0000 (+0800) Subject: Fix incorrect free for last_message X-Git-Tag: php-7.3.18RC1~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee21657a6a2d64e12ba03eae70dd7b7cb2569d82;p=php Fix incorrect free for last_message In commit a7305eb539596e175bd6c3ae9a20953358c5d677 the last_message field of the connection object was changed to be always non-persistent. But there is a place on change_user path that still treats it depending on conn->persistent flag. This will cause PHP crash after com_change_user success when there is last_message set --- diff --git a/ext/mysqlnd/mysqlnd_auth.c b/ext/mysqlnd/mysqlnd_auth.c index 30ef6639ca..2c50c1fdc5 100644 --- a/ext/mysqlnd/mysqlnd_auth.c +++ b/ext/mysqlnd/mysqlnd_auth.c @@ -481,7 +481,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn, conn->password.s = tmp; if (conn->last_message.s) { - mnd_pefree(conn->last_message.s, conn->persistent); + mnd_efree(conn->last_message.s); conn->last_message.s = NULL; } UPSERT_STATUS_RESET(conn->upsert_status);