Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8ae56822 authored by Florian Westphal's avatar Florian Westphal Committed by Pablo Neira Ayuso
Browse files

netfilter: ipt_CLUSTERIP: put config struct if we can't increment ct refcount



This needs to put() the entry to avoid a resource leak in error path.

Signed-off-by: default avatarFlorian Westphal <fw@strlen.de>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 9cb9c07d
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -496,12 +496,15 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par)
				return PTR_ERR(config);
		}
	}
	cipinfo->config = config;

	ret = nf_ct_netns_get(par->net, par->family);
	if (ret < 0)
	if (ret < 0) {
		pr_info("cannot load conntrack support for proto=%u\n",
			par->family);
		clusterip_config_entry_put(par->net, config);
		clusterip_config_put(config);
		return ret;
	}

	if (!par->net->xt.clusterip_deprecated_warning) {
		pr_info("ipt_CLUSTERIP is deprecated and it will removed soon, "
@@ -509,6 +512,7 @@ static int clusterip_tg_check(const struct xt_tgchk_param *par)
		par->net->xt.clusterip_deprecated_warning = true;
	}

	cipinfo->config = config;
	return ret;
}