[ovs-dev,1/4] pinctrl: Fix memory leak

Message ID 1515779132-28902-1-git-send-email-pkusunyifeng@gmail.com
State Accepted
Headers show
Series
  • [ovs-dev,1/4] pinctrl: Fix memory leak
Related show

Commit Message

Yifeng Sun Jan. 12, 2018, 5:45 p.m.
This bug is reported by valgrind (testing ovn -- 3 HVs, 1 LS, 3 lports/HV):

51,680 (27,968 direct, 23,712 indirect) bytes in 76 blocks are definitely lost in loss record 72 of 72
   at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4A8992: xcalloc (util.c:103)                                   
   by 0x493052: ovsdb_idl_index_init_row (ovsdb-idl.c:2343)            
   by 0x413F69: send_ipv6_ras (pinctrl.c:1321)                         
   by 0x413F69: pinctrl_run (pinctrl.c:1093)                           
   by 0x407348: main (ovn-controller.c:703)

Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>
---
 ovn/controller/pinctrl.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Ben Pfaff Jan. 23, 2018, 12:41 a.m. | #1
On Fri, Jan 12, 2018 at 09:45:29AM -0800, Yifeng Sun wrote:
> This bug is reported by valgrind (testing ovn -- 3 HVs, 1 LS, 3 lports/HV):
> 
> 51,680 (27,968 direct, 23,712 indirect) bytes in 76 blocks are definitely lost in loss record 72 of 72
>    at 0x4C2FB55: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
>    by 0x4A8992: xcalloc (util.c:103)                                   
>    by 0x493052: ovsdb_idl_index_init_row (ovsdb-idl.c:2343)            
>    by 0x413F69: send_ipv6_ras (pinctrl.c:1321)                         
>    by 0x413F69: pinctrl_run (pinctrl.c:1093)                           
>    by 0x407348: main (ovn-controller.c:703)
> 
> Signed-off-by: Yifeng Sun <pkusunyifeng@gmail.com>

Thanks, applied to master and branch-2.9.

Patch

diff --git a/ovn/controller/pinctrl.c b/ovn/controller/pinctrl.c
index 7542db3..d8bfde0 100644
--- a/ovn/controller/pinctrl.c
+++ b/ovn/controller/pinctrl.c
@@ -1371,6 +1371,7 @@  send_ipv6_ras(const struct controller_ctx *ctx, struct hmap *local_datapaths)
                 send_ipv6_ra_time = next_ra;
             }
         }
+        sbrec_port_binding_index_destroy_row(lpval);
     }
 
     /* Remove those that are no longer in the SB database */