]> granicus.if.org Git - libnl/commitdiff
netconf: Put nc reference in msg_parser
authorDavid Ahern <dsa@cumulusnetworks.com>
Thu, 21 Sep 2017 01:35:04 +0000 (19:35 -0600)
committerThomas Haller <thaller@redhat.com>
Thu, 21 Sep 2017 11:25:22 +0000 (13:25 +0200)
netconf_msg_parser is leaking memory. Add the put in the newly
allocated nc object to release the initial reference.

Signed-off-by: Anuradha Karuppiah <anuradhak@cumulusnetworks.com>
Signed-off-by: David Ahern <dsa@cumulusnetworks.com>
http://lists.infradead.org/pipermail/libnl/2017-September/002378.html

lib/route/netconf.c

index 0635dd7f2bcdc721dfb72561421bc004b045c32c..1d48c40e58e9113b480fb66b4fa9aeeca0a9b2b5 100644 (file)
@@ -173,7 +173,10 @@ static int netconf_msg_parser(struct nl_cache_ops *ops, struct sockaddr_nl *who,
                nc->ce_mask |= NETCONF_ATTR_INPUT;
        }
 
-       return pp->pp_cb((struct nl_object *) nc, pp);
+       err = pp->pp_cb((struct nl_object *) nc, pp);
+
+       rtnl_netconf_put(nc);
+       return err;
 }
 
 static int netconf_request_update(struct nl_cache *cache, struct nl_sock *sk)