From 0b9eaeb9112743044d9bb564bea9299f00269291 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 21 Sep 2009 16:10:42 -0700 Subject: [PATCH] netdev: Fix memory leak in get_stats_via_netlink(). Bug #1817. --- lib/netdev.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/netdev.c b/lib/netdev.c index 9a92a5f9..bed480f7 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -1058,6 +1058,7 @@ get_stats_via_netlink(int ifindex, struct netdev_stats *stats) if (!attrs[IFLA_STATS]) { VLOG_WARN_RL(&rl, "RTM_GETLINK reply lacks stats"); + ofpbuf_delete(reply); return EPROTO; } @@ -1084,6 +1085,8 @@ get_stats_via_netlink(int ifindex, struct netdev_stats *stats) stats->tx_heartbeat_errors = rtnl_stats->tx_heartbeat_errors; stats->tx_window_errors = rtnl_stats->tx_window_errors; + ofpbuf_delete(reply); + return 0; } -- 2.30.2