Skip to content

Commit

Permalink
tun-metadata: Fix memory leak in tun_metadata_table_mod().
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Yi-Hung Wei <[email protected]>
Signed-off-by: Joe Stringer <[email protected]>
  • Loading branch information
YiHungWei authored and joestringer committed Mar 4, 2017
1 parent 2b6a82d commit dea2dd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tun-metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit dea2dd0

Please sign in to comment.