X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=postlicyd%2Ffilter.c;h=e108b25c08ba46a4f949c0a2e7a0510da4d5a99c;hb=7fa8c1bc673add68529fa2bda8134be5089e8745;hp=14bfc9b3f22311fc62b90391c15aaba718a0196f;hpb=81227d766b6cd49042c042ac18c66bd9ec661d47;p=apps%2Fpfixtools.git diff --git a/postlicyd/filter.c b/postlicyd/filter.c index 14bfc9b..e108b25 100644 --- a/postlicyd/filter.c +++ b/postlicyd/filter.c @@ -281,6 +281,7 @@ bool filter_add_hook(filter_t *filter, const char *name, int name_len, const char *value, int value_len) { filter_hook_t hook; + hook.filter_id = -1; hook.type = hook_tokenize(name, name_len); if (hook.type == HTK_UNKNOWN) { err("unknown hook type %.*s", name_len, name); @@ -295,6 +296,7 @@ bool filter_add_hook(filter_t *filter, const char *name, int name_len, /* Value format is (counter:id:incr)?(postfix:reply|filter_name) */ + hook.value = NULL; if (strncmp(value, "counter:", 8) == 0) { char *end = NULL; value += 8; @@ -327,7 +329,6 @@ bool filter_add_hook(filter_t *filter, const char *name, int name_len, return false; } hook.value = m_strdup(hook.postfix ? value + 8 : value); - hook.filter_id = -1; array_add(filter->hooks, hook); return true; }