Skip to content

Commit

Permalink
ovn-controller: Fix memory leak of nat_ip_keys sset in send_garp_run().
Browse files Browse the repository at this point in the history
This commit fixes the following leak found by check-valgrind in the test:
"send gratuitous arp for nat ips in localnet"

sset gets allocated but not destroyed.

valgrind.14154-==14157== 1,892 bytes in 44 blocks are definitely lost in loss record 176 of 180
valgrind.14154-==14157==    at 0x4C29BFD: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
valgrind.14154-==14157==    by 0x48E1E7: xmalloc (util.c:112)
valgrind.14154-==14157==    by 0x487EDC: sset_add__ (sset.c:51)
valgrind.14154-==14157==    by 0x411A46: get_nat_addresses_and_keys (pinctrl.c:1231)
valgrind.14154-==14157==    by 0x411A46: send_garp_run (pinctrl.c:1260)
valgrind.14154-==14157==    by 0x411A46: pinctrl_run (pinctrl.c:787)
valgrind.14154:==14157==    by 0x407ABE: main (ovn-controller.c:451)

Signed-off-by: Ramu Ramamurthy <ramu.ramamurthy@us.ibm.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
  • Loading branch information
Ramu Ramamurthy authored and blp committed Aug 19, 2016
1 parent 576d1a8 commit 96a234a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ovn/controller/pinctrl.c
Expand Up @@ -1303,6 +1303,7 @@ send_garp_run(const struct ovsrec_bridge *br_int, const char *chassis_id,
sset_destroy(&local_l3gw_ports);
simap_destroy(&localnet_ofports);
shash_destroy_free_data(&nat_addresses);
sset_destroy(&nat_ip_keys);
}

static void
Expand Down

0 comments on commit 96a234a

Please sign in to comment.