Skip to content

Commit ee21657

Browse files
GuuBunikic
authored andcommitted
Fix incorrect free for last_message
In commit a7305eb 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
1 parent cf68bc4 commit ee21657

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/mysqlnd/mysqlnd_auth.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
481481
conn->password.s = tmp;
482482

483483
if (conn->last_message.s) {
484-
mnd_pefree(conn->last_message.s, conn->persistent);
484+
mnd_efree(conn->last_message.s);
485485
conn->last_message.s = NULL;
486486
}
487487
UPSERT_STATUS_RESET(conn->upsert_status);

0 commit comments

Comments
 (0)