secfilter: fix memmory leak on error
authorVictor Seva <linuxmaniac@torreviejawireless.org>
Wed, 19 Dec 2018 18:31:37 +0000 (19:31 +0100)
committerJose Luis Verdeguer <pepeluxx@gmail.com>
Thu, 20 Dec 2018 09:51:03 +0000 (10:51 +0100)
src/modules/secfilter/secfilter_db.c

index f6f4665..274a457 100644 (file)
@@ -211,6 +211,7 @@ int append_rule(int action, int type, str *value)
        new = shm_append_str_list(v, value->len, last_node, &total);
        if(!new) {
                LM_ERR("can't append new node\n");
+               shm_free(v);
                return -1;
        }
        LM_DBG("new node[%p] str:'%.*s'[%d]\n", new, new->s.len, new->s.s,