Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ovn-northd: Fix memory leak in case of distributed NAT.
In function get_nat_addresses(), memory reserved for c_addresses is not freed in case of distributed NAT (i.e., central_ip_address == false): ==22493== 36 bytes in 2 blocks are definitely lost in loss record 176 of 444 ==22493== at 0x4C29DAD: malloc (vg_replace_malloc.c:308) ==22493== by 0x4C2C100: realloc (vg_replace_malloc.c:836) ==22493== by 0x4E3E9D: xrealloc (util.c:149) ==22493== by 0x47EEBB: ds_reserve (dynamic-string.c:63) ==22493== by 0x47F32E: ds_put_format_valist (dynamic-string.c:161) ==22493== by 0x47F258: ds_put_format (dynamic-string.c:142) ==22493== by 0x40D74E: get_nat_addresses (ovn-northd.c:2337) ==22493== by 0x40F75B: ovn_port_update_sbrec (ovn-northd.c:2981) ==22493== by 0x4112E8: build_ports (ovn-northd.c:3505) ==22493== by 0x42922C: ovnnb_db_run (ovn-northd.c:11138) ==22493== by 0x42A49D: ovn_db_run (ovn-northd.c:11692) ==22493== by 0x42B484: main (ovn-northd.c:12055) To fix this we always call ds_destroy(&c_addresses). Fixes: 7b1f4da ("ovn: Gratuitous ARP for distributed NAT rules") Signed-off-by: Dumitru Ceara <dceara@redhat.com> Acked-by: Ilya Maximets <i.maximets@ovn.org> Signed-off-by: Numan Siddique <numans@ovn.org>
- Loading branch information