]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/tipc/netlink_compat.c
tipc: fix memory leak in tipc_nl_compat_publ_dump
[linux.git] / net / tipc / netlink_compat.c
index 40f5cae623a77d73a34f05f1974c8a3292c18f83..77e4b2418f302555acac4813d3baa39b356e632e 100644 (file)
@@ -904,8 +904,10 @@ static int tipc_nl_compat_publ_dump(struct tipc_nl_compat_msg *msg, u32 sock)
 
        hdr = genlmsg_put(args, 0, 0, &tipc_genl_family, NLM_F_MULTI,
                          TIPC_NL_PUBL_GET);
-       if (!hdr)
+       if (!hdr) {
+               kfree_skb(args);
                return -EMSGSIZE;
+       }
 
        nest = nla_nest_start(args, TIPC_NLA_SOCK);
        if (!nest) {