Removed leak for service with more listeners

Removed leak for service with more listeners:

users are allocated once in service
This commit is contained in:
MassimilianoPinto
2014-11-10 11:08:12 +01:00
parent 37fa9668a9
commit 071e15048d

View File

@ -213,6 +213,7 @@ GWPROTOCOL *funcs;
if (strcmp(port->protocol, "MySQLClient") == 0) {
int loaded;
if (service->users == NULL) {
/*
* Allocate specific data for MySQL users
* including hosts and db names
@ -245,11 +246,14 @@ GWPROTOCOL *funcs;
"Loaded %d MySQL Users for service [%s].",
loaded, service->name)));
}
}
else
{
if (service->users == NULL) {
/* Generic users table */
service->users = users_alloc();
}
}
if ((funcs=(GWPROTOCOL *)load_module(port->protocol, MODULE_PROTOCOL))
== NULL)