diff mbox

[ovs-dev,PATCHv2,1/2] ovs-router: fix memory leak reported by valgrind.

Message ID 1486566234-37570-1-git-send-email-u9012063@gmail.com
State Accepted
Headers show

Commit Message

William Tu Feb. 8, 2017, 3:03 p.m. UTC
Valgrind testcase 772: appctl - route/lookup6 reports the
following definitely lost:
  xmalloc (util.c:112)
  miniflow_alloc (flow.c:2500)
  minimatch_init (match.c:1387)
  rt_entry_delete (ovs-router.c:274)
  ovs_router_del (ovs-router.c:384)
  process_command (unixctl.c:313)

Signed-off-by: William Tu <u9012063@gmail.com>
---
 lib/ovs-router.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Andy Zhou Feb. 8, 2017, 7:22 p.m. UTC | #1
On Wed, Feb 8, 2017 at 7:03 AM, William Tu <u9012063@gmail.com> wrote:
> Valgrind testcase 772: appctl - route/lookup6 reports the
> following definitely lost:
>   xmalloc (util.c:112)
>   miniflow_alloc (flow.c:2500)
>   minimatch_init (match.c:1387)
>   rt_entry_delete (ovs-router.c:274)
>   ovs_router_del (ovs-router.c:384)
>   process_command (unixctl.c:313)
>
> Signed-off-by: William Tu <u9012063@gmail.com>

Acked-by: Andy Zhou <azhou@ovn.org>
diff mbox

Patch

diff --git a/lib/ovs-router.c b/lib/ovs-router.c
index d98de20..0c5430a 100644
--- a/lib/ovs-router.c
+++ b/lib/ovs-router.c
@@ -280,6 +280,8 @@  rt_entry_delete(uint32_t mark, uint8_t priority,
         res = __rt_entry_delete(cr);
         ovs_mutex_unlock(&mutex);
     }
+
+    cls_rule_destroy(&rule);
     return res;
 }