[ovs-dev] [PATCH 2/2] Fix memory leak in nbctl_lrp_add.

nickcooper-zhangtonghao nickcooper-zhangtonghao at opencloud.tech
Mon Oct 3 15:19:09 UTC 2016


Signed-off-by: nickcooper-zhangtonghao <nickcooper-zhangtonghao at opencloud.tech>
---
 ovn/utilities/ovn-nbctl.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c
index 563c6ec..71cffda 100644
--- a/ovn/utilities/ovn-nbctl.c
+++ b/ovn/utilities/ovn-nbctl.c
@@ -1810,6 +1810,8 @@ nbctl_lrp_add(struct ctl_context *ctx)
         sset_add_array(&orig_networks, lrp->networks, lrp->n_networks);
 
         if (!sset_equals(&orig_networks, &new_networks)) {
+            sset_destroy(&orig_networks);
+            sset_destroy(&new_networks);
             ctl_fatal("%s: port already exists with different network",
                       lrp_name);
         }
-- 
1.8.3.1







More information about the dev mailing list