This commit fixes a place in bridge.c where smap_destroy() is not
always called after smap_init().  Though there is no memory leak
now, it is necessary to fix it and prevent memory leak in the
future when smap_init() may be modified to allocate dynamic memory.

Reported-by: Ansis Atteka <aatt...@nicira.com>
Signed-off-by: Alex Wang <al...@nicira.com>

---

v1 -> v2:
- refine commit log title.

---
 vswitchd/bridge.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c
index f49292b..ba066da 100644
--- a/vswitchd/bridge.c
+++ b/vswitchd/bridge.c
@@ -2263,8 +2263,8 @@ instant_stats_run(void)
                                                     &smap);
                 if (!error || error == ENOENT) {
                     ovsrec_interface_set_bfd_status(iface->cfg, &smap);
-                    smap_destroy(&smap);
                 }
+                smap_destroy(&smap);
             }
         }
     }
-- 
1.7.9.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to