Fix some small memory leaks.

This commit is contained in:
Jan Vidar Krey
2010-04-21 18:34:55 +02:00
parent b6fb2b41bd
commit 076492f1b9
4 changed files with 15 additions and 22 deletions

View File

@@ -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;
}