summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYi-Hung Wei <yihung.wei@gmail.com>2017-02-07 13:14:27 -0800
committerJoe Stringer <joe@ovn.org>2017-03-03 17:04:50 -0800
commitdea2dd0f19bc6bb5045d0a4259f0f4c5557aa9b8 (patch)
tree2fa9ebcac58f27ece43f02fbb8656ef0753f3780 /lib
parent2b6a82dadbd5577fd89fd4cdde313e9e0f7b532c (diff)
downloadopenvswitch-dea2dd0f19bc6bb5045d0a4259f0f4c5557aa9b8.tar.gz
tun-metadata: Fix memory leak in tun_metadata_table_mod().
In testcase "tunnel - Geneve metadata", valgrind reports a memory leak with the following call stack. xcalloc (util.c:95) tun_metadata_alloc (tun-metadata.c:89) tun_metadata_table_mod (tun-metadata.c:151) handle_tlv_table_mod (ofproto.c:7782) handle_openflow__ (ofproto.c:7961) handle_openflow (ofproto.c:8023) ofconn_run (connmgr.c:1427) connmgr_run (connmgr.c:363) ofproto_run (ofproto.c:1813) bridge_run__ (bridge.c:2899) bridge_run (bridge.c:2956) main (ovs-vswitchd.c:111) Reported-by: William Tu <u9012063@gmail.com> Signed-off-by: Yi-Hung Wei <yihung.wei@gmail.com> Signed-off-by: Joe Stringer <joe@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/tun-metadata.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/tun-metadata.c b/lib/tun-metadata.c
index eb27e2560..08858f114 100644
--- a/lib/tun-metadata.c
+++ b/lib/tun-metadata.c
@@ -156,8 +156,8 @@ tun_metadata_table_mod(struct ofputil_tlv_table_mod *ttm,
ofp_map->option_type,
ofp_map->option_len);
if (err) {
- *new_tab = NULL;
tun_metadata_free(*new_tab);
+ *new_tab = NULL;
return err;
}
}