This leak was reported by valgrind (testing vlog - vlog/close - C):

53 bytes in 1 blocks are definitely lost in loss record 60 of 66      
    by 0x4D1214: xmalloc (util.c:120)                                  
    by 0x4D1284: xmemdup0 (util.c:150)                                 
    by 0x4D7AF9: vlog_set_log_file (vlog.c:402)                        
    by 0x42C1AB: parse_options (test-unixctl.c:155)                    
    by 0x42C1AB: test_unixctl_main (test-unixctl.c:84)                 
    by 0x42C1AB: ovstest_wrapper_test_unixctl_main__ (test-unixctl.c:186)
    by 0x43C743: ovs_cmdl_run_command__ (command-line.c:115)           
    by 0x406C09: main (ovstest.c:133)

Signed-off-by: Yifeng Sun <[email protected]>
---
 lib/vlog.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/vlog.c b/lib/vlog.c
index 6e87665..a5c0c5e 100644
--- a/lib/vlog.c
+++ b/lib/vlog.c
@@ -696,6 +696,8 @@ vlog_unixctl_close(struct unixctl_conn *conn, int argc 
OVS_UNUSED,
     if (log_fd >= 0) {
         close(log_fd);
         log_fd = -1;
+        free(log_file_name);
+        log_file_name = NULL;
 
         async_append_destroy(log_writer);
         log_writer = NULL;
-- 
2.7.4

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to