system-linux: free netlink messages after sending
authorSteven Barth <steven@midlink.org>
Mon, 26 Sep 2011 17:20:05 +0000 (17:20 +0000)
committerSteven Barth <steven@midlink.org>
Mon, 26 Sep 2011 17:20:05 +0000 (17:20 +0000)
system-linux.c

index d09fd635a8485ae955ae8e028b2ff4028c290aab..483108815f2ead9ddd9473f3c2b4a4885fd3df2e 100644 (file)
@@ -36,8 +36,10 @@ int system_init(void)
 
 static int system_rtnl_call(struct nl_msg *msg)
 {
-       return -(nl_send_auto_complete(sock_rtnl, msg)
+       int s = -(nl_send_auto_complete(sock_rtnl, msg)
                        || nl_wait_for_ack(sock_rtnl));
+       nlmsg_free(msg);
+       return s;
 }
 
 int system_bridge_addbr(struct device *bridge)