Since verdict expression frees the chain name, pass a newly allocated
string to it. Otherwise double free happens because json_decref() frees
the string property value as well.
Fixes: d1057a5feb5fd ("JSON: Simplify verdict statement parsing")
Signed-off-by: Phil Sutter <phil@nwl.cc>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
return NULL;
return verdict_expr_alloc(int_loc,
- verdict_tbl[i].verdict, chain);
+ verdict_tbl[i].verdict,
+ chain ? xstrdup(chain) : NULL);
}
json_error(ctx, "Unknown verdict '%s'.", type);
return NULL;