Skip to content

Commit

Permalink
fix mem leak in permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
ionutrazvanionita committed Nov 2, 2015
1 parent 3c1ffb1 commit 5f3981c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions modules/permissions/address.c
Expand Up @@ -255,10 +255,17 @@ int reload_address_table(struct pm_part_struct *part_struct)
if (subnet_table_insert(new_subnet_table, group, subnet,
port, proto, &str_pattern, &str_info) == -1) {
LM_ERR("subnet table problem\n");
if (subnet) {
pkg_free(subnet);
}
goto error;
}
LM_DBG("Tuple <%.*s, %u, %u, %u> inserted into subnet table\n",
str_src_ip.len, str_src_ip.s, group, mask, port);
/* subnet in pkg; needs to be freed since was copied to shm */
if (subnet) {
pkg_free(subnet);
}
}
}

Expand Down

0 comments on commit 5f3981c

Please sign in to comment.