- move from char* + len to MYSQLND_STRING
- add some more const modifiers
This commit is contained in:
Andrey Hristov 2015-11-10 12:34:27 +01:00
parent a530ecff97
commit c286d7075d
7 changed files with 82 additions and 83 deletions

View file

@ -271,18 +271,18 @@ mysqlnd_auth_change_user(MYSQLND_CONN_DATA * const conn,
}
if (ret == PASS) {
char * tmp = NULL;
/* if we get conn->user as parameter and then we first free it, then estrndup it, we will crash */
/* if we get conn->username as parameter and then we first free it, then estrndup it, we will crash */
tmp = mnd_pestrndup(user, user_len, conn->persistent);
if (conn->user) {
mnd_pefree(conn->user, conn->persistent);
if (conn->username.s) {
mnd_pefree(conn->username.s, conn->persistent);
}
conn->user = tmp;
conn->username.s = tmp;
tmp = mnd_pestrdup(passwd, conn->persistent);
if (conn->passwd) {
mnd_pefree(conn->passwd, conn->persistent);
if (conn->password.s) {
mnd_pefree(conn->password.s, conn->persistent);
}
conn->passwd = tmp;
conn->password.s = tmp;
if (conn->last_message.s) {
mnd_pefree(conn->last_message.s, conn->persistent);