addr_resolv: don't free the same wmem_list entry twice
authorMartin Kaiser <wireshark@kaiser.cx>
Sat, 23 Apr 2016 11:58:09 +0000 (13:58 +0200)
committerMartin Kaiser <wireshark@kaiser.cx>
Sat, 23 Apr 2016 12:03:05 +0000 (12:03 +0000)
commit9fbd4e6fcd28bbc2ea2223b19c0072f6a83192bb
tree400808698fdbd884ef172203dff3044bf8c08453
parent76ae74cea34c47e25e4e387ee3990ba7c1231e6e
addr_resolv: don't free the same wmem_list entry twice

fetch the list head each time we iterate through the list

if we don't, we crash when the same entry is removed a second time

 #0  wmem_block_remove_from_block_list (block=0x7fffecd7b1c0, allocator=<optimized out>) at wmem_allocator_block.c:738
 #1  wmem_block_free_jumbo (chunk=0x7fffecd7b1d0, allocator=0x65c060) at wmem_allocator_block.c:822
 #2  wmem_block_free (private_data=0x65c060, ptr=0x7fffecd7b1e0) at wmem_allocator_block.c:913
 #3  0x00007ffff452eac1 in host_name_lookup_process () at addr_resolv.c:2466
 #4  0x000000000041733d in process_packet (cf=cf@entry=0x63fe20, edt=edt@entry=0xce08f0, offset=<optimized out>, whdr=0xc97c70,
    pd=pd@entry=0xc9f550 "", tap_flags=tap_flags@entry=0) at tshark.c:3699
 #5  0x000000000040f199 in load_cap_file (max_byte_count=13197776, max_packet_count=<optimized out>, out_file_name_res=0,
    out_file_type=2, save_file=0x0, cf=<optimized out>) at tshark.c:3483
 #6  main (argc=<optimized out>, argv=<optimized out>) at tshark.c:2192

Change-Id: I1ac813242188842130f4070ef326b12fe23b782f
Reviewed-on: https://code.wireshark.org/review/15068
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
epan/addr_resolv.c