]> granicus.if.org Git - php/commitdiff
Fix incorrect free for last_message
authorQianqian Bu <qibu@microsoft.com>
Fri, 3 Apr 2020 07:44:41 +0000 (15:44 +0800)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 3 Apr 2020 08:05:16 +0000 (10:05 +0200)
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

ext/mysqlnd/mysqlnd_auth.c

index 30ef6639cac4700d2ad40943f323dad550b96662..2c50c1fdc57ffce936f66baef2fef6c4166e4412 100644 (file)
@@ -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);