mirror of
https://github.com/ZoneMinder/zoneminder.git
synced 2026-05-18 11:35:15 -04:00
fix double free of mysql result
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user