mirror of
https://github.com/MariaDB/server.git
synced 2025-10-12 12:25:37 +03:00
Fixed memory leak caused by user deletion, aswell as invalid free caused by
user creation.
This commit is contained in:
committed by
Sergei Golubchik
parent
7e18b8f1d6
commit
e876aa2b3b
@@ -1772,6 +1772,8 @@ static void acl_insert_user(const char *user, const char *host,
|
||||
acl_user.ssl_cipher= ssl_cipher ? strdup_root(&mem,ssl_cipher) : 0;
|
||||
acl_user.x509_issuer= x509_issuer ? strdup_root(&mem,x509_issuer) : 0;
|
||||
acl_user.x509_subject=x509_subject ? strdup_root(&mem,x509_subject) : 0;
|
||||
(void) my_init_dynamic_array(&acl_user.role_grants, sizeof(ACL_USER *),
|
||||
50, 100, MYF(0));
|
||||
|
||||
(void) push_dynamic(&acl_users,(uchar*) &acl_user);
|
||||
if (!acl_user.host.hostname ||
|
||||
@@ -6474,6 +6476,7 @@ static int handle_grant_struct(enum enum_acl_lists struct_no, bool drop,
|
||||
elements--;
|
||||
switch ( struct_no ) {
|
||||
case USER_ACL:
|
||||
free_acl_user(dynamic_element(&acl_users, idx, ACL_USER*));
|
||||
delete_dynamic_element(&acl_users, idx);
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user