Fix some small memory leaks.
This commit is contained in:
@@ -358,20 +358,10 @@ int acl_is_user_denied(struct acl_handle* handle, const char* data)
|
||||
|
||||
int acl_user_ban_nick(struct acl_handle* handle, const char* nick)
|
||||
{
|
||||
char* data = 0;
|
||||
struct hub_user_access_info* info = hub_malloc_zero(sizeof(struct hub_user_access_info));
|
||||
|
||||
if (!info)
|
||||
{
|
||||
LOG_ERROR("ACL error: Out of memory!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
data = hub_strdup(nick);
|
||||
char* data = hub_strdup(nick);
|
||||
if (!data)
|
||||
{
|
||||
LOG_ERROR("ACL error: Out of memory!");
|
||||
hub_free(info);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -381,19 +371,10 @@ int acl_user_ban_nick(struct acl_handle* handle, const char* nick)
|
||||
|
||||
int acl_user_ban_cid(struct acl_handle* handle, const char* cid)
|
||||
{
|
||||
char* data;
|
||||
struct hub_user_access_info* info = hub_malloc_zero(sizeof(struct hub_user_access_info));
|
||||
if (!info)
|
||||
{
|
||||
LOG_ERROR("ACL error: Out of memory!");
|
||||
return -1;
|
||||
}
|
||||
|
||||
data = hub_strdup(cid);
|
||||
char* data = hub_strdup(cid);
|
||||
if (!data)
|
||||
{
|
||||
LOG_ERROR("ACL error: Out of memory!");
|
||||
hub_free(info);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -950,7 +950,12 @@ void hub_send_status(struct hub_info* hub, struct hub_user* user, enum status_me
|
||||
char* escaped_text = 0;
|
||||
int reconnect_time = 0;
|
||||
|
||||
if (!cmd) return;
|
||||
if (!cmd || !qui)
|
||||
{
|
||||
adc_msg_free(cmd);
|
||||
adc_msg_free(qui);
|
||||
return;
|
||||
}
|
||||
|
||||
#define STATUS(CODE, MSG, FLAG, RCONTIME) case status_ ## MSG : set_status_code(level, CODE, code); text = cfg->MSG; flag = FLAG; reconnect_time = RCONTIME; break
|
||||
switch (msg)
|
||||
|
||||
Reference in New Issue
Block a user