forked from openvswitch/ovs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test-aa: Fix memory leak reported by valgrind.
test case 1698: auto-attach - packet tests Report several leaks at lldp_create_dummy(), the patch fixes the following 3 leaks: {lldp_send (lldp.c:334), lldp_decode (lldp.c:374), lldp_create_dummy (ovs-lldp.c:890)} test_aa_send (test-aa.c:252) test_aa_main (test-aa.c:281) Comments: 1. Create a new function "lldp_destroy_dummy()" because many structures and its elements, ex: lldp_hardware and lldp_chassis, are from stack not heap (see test_aa_send). As a result, calling lldpd_cleanup() is incorrect. 2. Remove lchassis->c_id = xmalloc(ETH_ADDR_LEN); because it is overwritten at test_aa_send() 3. remove memcpy(&hw->h_lport.p_element.system_id.system_mac, lchassis->c_id, lchassis->c_id_len); because the source buf is empty Signed-off-by: William Tu <[email protected]> Signed-off-by: Ben Pfaff <[email protected]>
- Loading branch information
Showing
3 changed files
with
36 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters