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 <u9012063@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>