[NETFILTER]: ctnetlink: fix leak in ctnetlink_create_conntrack error path
Patrick McHardy [Tue, 16 Jan 2007 01:16:03 +0000 (17:16 -0800)]
Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

net/ipv4/netfilter/ip_conntrack_netlink.c
net/netfilter/nf_conntrack_netlink.c

index 5fcf91d..6f31fad 100644 (file)
@@ -959,7 +959,7 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
        if (cda[CTA_PROTOINFO-1]) {
                err = ctnetlink_change_protoinfo(ct, cda);
                if (err < 0)
-                       return err;
+                       goto err;
        }
 
 #if defined(CONFIG_IP_NF_CONNTRACK_MARK)
index bd1d2de..811e3e7 100644 (file)
@@ -981,7 +981,7 @@ ctnetlink_create_conntrack(struct nfattr *cda[],
        if (cda[CTA_PROTOINFO-1]) {
                err = ctnetlink_change_protoinfo(ct, cda);
                if (err < 0)
-                       return err;
+                       goto err;
        }
 
 #if defined(CONFIG_NF_CONNTRACK_MARK)