platform: fix memleak in link_delete()
authorThomas Haller <thaller@redhat.com>
Wed, 13 May 2015 11:54:08 +0000 (13:54 +0200)
committerThomas Haller <thaller@redhat.com>
Wed, 13 May 2015 12:24:06 +0000 (14:24 +0200)
Turns out, the valgrind suppression was hiding a memleak

src/platform/nm-linux-platform.c
valgrind.suppressions

index 7f700c2..5b9a33f 100644 (file)
@@ -2516,7 +2516,7 @@ static gboolean
 link_delete (NMPlatform *platform, int ifindex)
 {
        NMLinuxPlatformPrivate *priv = NM_LINUX_PLATFORM_GET_PRIVATE (platform);
-       struct rtnl_link *rtnllink = rtnl_link_get (priv->link_cache, ifindex);
+       auto_nl_object struct rtnl_link *rtnllink = rtnl_link_get (priv->link_cache, ifindex);
 
        if (!rtnllink) {
                platform->error = NM_PLATFORM_ERROR_NOT_FOUND;
index 5f89c98..b0d5301 100644 (file)
 # libnl3
 ###############################################################
 
-{
-   libnl_01
-   Memcheck:Leak
-   match-leak-kinds: definite
-   fun:calloc
-   fun:nl_object_alloc
-   fun:link_msg_parser
-   fun:__pickup_answer
-   fun:nl_cb_call
-   fun:recvmsgs
-   fun:nl_recvmsgs_report
-   fun:nl_recvmsgs
-   fun:nl_pickup
-   fun:rtnl_link_get_kernel
-   ...
-}
 {
    # fixed by https://github.com/thom311/libnl/commit/d65c32a7205e679c7fc13f0e4565b13e698ba906
    libnl_rtnl_link_set_type_01