3570 |
|
if (ypass == 2) |
3571 |
|
{ |
3572 |
|
yy_conf = make_conf_item(GDENY_TYPE); |
3573 |
< |
yy_aconf = (struct AccessItem *)map_to_conf(yy_conf); |
3574 |
< |
yy_aconf->flags = 0; |
3573 |
> |
yy_aconf = map_to_conf(yy_conf); |
3574 |
|
} |
3575 |
|
} '{' gline_items '}' ';' |
3576 |
|
{ |
3580 |
|
* since we re-allocate yy_conf/yy_aconf after the end of action=, at the |
3581 |
|
* end we will have one extra, so we should free it. |
3582 |
|
*/ |
3583 |
< |
if (yy_conf->name == NULL && gdeny_items.length) |
3583 |
> |
if (yy_conf->name == NULL || yy_aconf->user == NULL) |
3584 |
|
{ |
3585 |
< |
dlinkDelete(gdeny_items.tail, &gdeny_items); |
3587 |
< |
MyFree(yy_conf); |
3585 |
> |
delete_conf_item(yy_conf); |
3586 |
|
yy_conf = NULL; |
3587 |
|
yy_aconf = NULL; |
3588 |
|
} |
3630 |
|
{ |
3631 |
|
if (ypass == 2) |
3632 |
|
{ |
3633 |
< |
struct CollectItem *yy_tmp; |
3633 |
> |
struct CollectItem *yy_tmp = NULL; |
3634 |
|
|
3635 |
|
if (yy_aconf->user == NULL) |
3636 |
|
{ |
3638 |
|
} |
3639 |
|
else |
3640 |
|
{ |
3641 |
< |
yy_tmp = (struct CollectItem *)MyMalloc(sizeof(struct CollectItem)); |
3641 |
> |
yy_tmp = MyMalloc(sizeof(struct CollectItem)); |
3642 |
|
split_nuh(yylval.string, NULL, &yy_tmp->user, &yy_tmp->host); |
3643 |
|
dlinkAdd(yy_tmp, &yy_tmp->node, &col_conf_list); |
3644 |
|
} |
3662 |
|
{ |
3663 |
|
if (ypass == 2) |
3664 |
|
{ |
3665 |
< |
struct CollectItem *yy_tmp; |
3665 |
> |
struct CollectItem *yy_tmp = NULL; |
3666 |
|
dlink_node *ptr, *next_ptr; |
3667 |
|
|
3668 |
|
DLINK_FOREACH_SAFE(ptr, next_ptr, col_conf_list.head) |
3672 |
|
|
3673 |
|
yy_tmp = ptr->data; |
3674 |
|
new_conf = make_conf_item(GDENY_TYPE); |
3675 |
< |
new_aconf = (struct AccessItem *)map_to_conf(new_conf); |
3675 |
> |
new_aconf = map_to_conf(new_conf); |
3676 |
|
|
3677 |
|
new_aconf->flags = yy_aconf->flags; |
3678 |
|
|
3691 |
|
|
3692 |
|
dlinkDelete(&yy_tmp->node, &col_conf_list); |
3693 |
|
} |
3694 |
+ |
|
3695 |
+ |
/* |
3696 |
+ |
* In case someone has fed us with more than one action= after user/name |
3697 |
+ |
* which would leak memory -Michael |
3698 |
+ |
*/ |
3699 |
+ |
if (yy_conf->name == NULL || yy_aconf->user == NULL) |
3700 |
+ |
delete_conf_item(yy_conf); |
3701 |
+ |
|
3702 |
+ |
yy_conf = make_conf_item(GDENY_TYPE); |
3703 |
+ |
yy_aconf = map_to_conf(yy_conf); |
3704 |
|
} |
3705 |
|
}; |
3706 |
|
|