swconfig: swlib.c: Fix another memleak
authornbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 8 Jul 2015 15:59:38 +0000 (15:59 +0000)
committernbd <nbd@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Wed, 8 Jul 2015 15:59:38 +0000 (15:59 +0000)
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@46275 3c298f89-4303-0410-b956-a3cf2f4a3e73

package/network/config/swconfig/src/swlib.c

index d9ef62f..0dbace5 100644 (file)
@@ -529,10 +529,13 @@ struct switch_attr *swlib_lookup_attr(struct switch_dev *dev,
 static void
 swlib_priv_free(void)
 {
+       if (family)
+               nl_object_put((struct nl_object*)family);
        if (cache)
                nl_cache_free(cache);
        if (handle)
                nl_socket_free(handle);
+       family = NULL;
        handle = NULL;
        cache = NULL;
 }