]> git.proxmox.com Git - ovs.git/commitdiff
ovn: fix ovn-northd leaks in build_acl
authorRamu Ramamurthy <ramu.ramamurthy@gmail.com>
Fri, 2 Sep 2016 00:05:50 +0000 (00:05 +0000)
committerRussell Bryant <russell@ovn.org>
Thu, 8 Sep 2016 14:14:26 +0000 (10:14 -0400)
The following leaks are due to missing ds_destroy in a few
places in build_acl.

5,850 bytes in 50 blocks are definitely lost in loss record 93 of 93
   at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x449507: xrealloc (util.c:123)
   by 0x42CC73: ds_reserve (dynamic-string.c:63)
   by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
   by 0x42D176: ds_put_format (dynamic-string.c:142)
   by 0x40D380: build_acls (ovn-northd.c:2320)
   by 0x40D380: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
   by 0x4072D9: build_lflows (ovn-northd.c:3845)
   by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
   by 0x4072D9: main (ovn-northd.c:4375)

9,360 bytes in 72 blocks are definitely lost in loss record 93 of 93
   at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x4C2BACB: realloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x449507: xrealloc (util.c:123)
   by 0x42CC73: ds_reserve (dynamic-string.c:63)
   by 0x42D08F: ds_put_format_valist (dynamic-string.c:161)
   by 0x42D176: ds_put_format (dynamic-string.c:142)
   by 0x40D505: build_acls (ovn-northd.c:2346)
   by 0x40D505: build_lswitch_flows.constprop.36 (ovn-northd.c:2472)
   by 0x4072D9: build_lflows (ovn-northd.c:3845)
   by 0x4072D9: ovnnb_db_run (ovn-northd.c:3971)
   by 0x4072D9: main (ovn-northd.c:4375)

Signed-off-by: Ramu Ramamurthy <ramu.ramamurthy@us.ibm.com>
Acked-by: Ryan Moats <rmoats@us.ibm.com>
Signed-off-by: Russell Bryant <russell@ovn.org>
ovn/northd/ovn-northd.c

index 0ad9190d6b99fc4f89bb32aba131261c35e786d3..1731332d0470e85a6d7497c925678cd1d313cd76 100644 (file)
@@ -2342,6 +2342,7 @@ build_acls(struct ovn_datapath *od, struct hmap *lflows)
                 ovn_lflow_add(
                     lflows, od, S_SWITCH_OUT_ACL, 34000, ds_cstr(&match),
                     actions);
+                ds_destroy(&match);
             }
         }
 
@@ -2368,6 +2369,7 @@ build_acls(struct ovn_datapath *od, struct hmap *lflows)
                 ovn_lflow_add(
                     lflows, od, S_SWITCH_OUT_ACL, 34000, ds_cstr(&match),
                     actions);
+                ds_destroy(&match);
             }
         }
     }