fix double free of mysql result

This commit is contained in:
Isaac Connor committed 2021-01-15 14:43:31 -05:00
1 parent 23305be8bf
commit 0a0c99ce7a
1 file changed
+3 -1
+3 -1
View File
@@ -133,6 +133,7 @@ User *zmLoadUser(const char *username, const char *password) {
MYSQL_ROW dbrow = mysql_fetch_row(result);
User *user = new User(dbrow);
mysql_free_result(result);
result = nullptr;
if (
(! password ) // relay type must be none
@@ -142,7 +143,8 @@ User *zmLoadUser(const char *username, const char *password) {
return user;
}
} // end if 1 result from db
mysql_free_result(result);
if ( result )
mysql_free_result(result);
Warning("Unable to authenticate user %s", username);
return nullptr;