<html>
<head>
<base href="https://bugzilla.netfilter.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Calling the nftnl_set_free function may trigger the "double free" problem."
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1685#c7">Comment # 7</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Calling the nftnl_set_free function may trigger the "double free" problem."
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1685">bug 1685</a>
from <span class="vcard"><a class="email" href="mailto:pablo@netfilter.org" title="Pablo Neira Ayuso <pablo@netfilter.org>"> <span class="fn">Pablo Neira Ayuso</span></a>
</span></b>
<pre><span class="quote">> diff --git a/src/set.c b/src/set.c
> index c46f827..738cc24 100644
> --- a/src/set.c
> +++ b/src/set.c
> @@ -54,8 +54,11 @@ void nftnl_set_free(const struct nftnl_set *s)
> if (s->flags & (1 << NFTNL_SET_USERDATA))
> xfree(s->user.data);
>
> - list_for_each_entry_safe(expr, next, &s->expr_list, head)
> - nftnl_expr_free(expr);
> + if (s->flags & (1 << NFTNL_SET_EXPR))
> + {
> + list_for_each_entry_safe(expr, next, &s->expr_list, head)
> + nftnl_expr_free(expr);
> + }</span >
Maybe this instead?
list_for_each_entry_safe(expr, next, &s->expr_list, head) {
list_del(&expr->list);
nftnl_expr_free(expr);
}</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>