vcc_acl: Create template acl_e on the stack

We only ever insert copies into the tree in vcc_acl_add_entry()
parent aff516b7
...@@ -350,10 +350,10 @@ vcc_acl_try_netnotation(struct vcc *tl, struct acl_e *ae) ...@@ -350,10 +350,10 @@ vcc_acl_try_netnotation(struct vcc *tl, struct acl_e *ae)
static void static void
vcc_acl_entry(struct vcc *tl) vcc_acl_entry(struct vcc *tl)
{ {
struct acl_e *ae; struct acl_e ae[1];
char *sl, *e; char *sl, *e;
ALLOC_OBJ(ae, VCC_ACL_E_MAGIC); INIT_OBJ(ae, VCC_ACL_E_MAGIC);
if (tl->t->tok == '!') { if (tl->t->tok == '!') {
ae->not = 1; ae->not = 1;
...@@ -385,14 +385,12 @@ vcc_acl_entry(struct vcc *tl) ...@@ -385,14 +385,12 @@ vcc_acl_entry(struct vcc *tl)
if (*e != '\0') { if (*e != '\0') {
VSB_cat(tl->sb, ".../mask is not numeric.\n"); VSB_cat(tl->sb, ".../mask is not numeric.\n");
vcc_ErrWhere(tl, ae->t_addr); vcc_ErrWhere(tl, ae->t_addr);
FREE_OBJ(ae);
return; return;
} }
ae->t_mask = ae->t_addr; ae->t_mask = ae->t_addr;
if (tl->t->tok == '/') { if (tl->t->tok == '/') {
VSB_cat(tl->sb, "/mask only allowed once.\n"); VSB_cat(tl->sb, "/mask only allowed once.\n");
vcc_ErrWhere(tl, tl->t); vcc_ErrWhere(tl, tl->t);
FREE_OBJ(ae);
return; return;
} }
} else if (tl->t->tok == '/') { } else if (tl->t->tok == '/') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment