Fixed issue where mysql_free_result can get called twice when a vaild username with an incorrect password is used.

This commit is contained in:
Terry Sanders 2021-01-19 14:47:11 +00:00
parent 0b35a6f09a
commit ef006ca407
1 changed files with 1 additions and 1 deletions

View File

@ -132,12 +132,12 @@ User *zmLoadUser(const char *username, const char *password) {
if ( mysql_num_rows(result) == 1 ) {
MYSQL_ROW dbrow = mysql_fetch_row(result);
User *user = new User(dbrow);
mysql_free_result(result);
if (
(! password ) // relay type must be none
||
verifyPassword(username, password, user->getPassword()) ) {
mysql_free_result(result);
Info("Authenticated user '%s'", user->getUsername());
return user;
}