5 allocate_file = open(
"/tmp/memory_allocate.log",
"r") 6 allocate_lines = allocate_file.readlines() 10 free_file = open(
"/tmp/memory_free.log",
"r") 11 free_lines = free_file.readlines() 15 for free_line
in free_lines:
16 free_fields = free_line.split()
17 free_address = free_fields[0]
19 free_table[free_address] =
None 22 for allocate_line
in allocate_lines:
23 allocate_fields = allocate_line.split()
24 allocate_address = allocate_fields[0]
25 allocate_from = allocate_fields[1]
26 leak = (allocate_address, allocate_from)
27 if not allocate_address
in free_table:
32 print(
"{0}: {1}".format(leak[0], leak[1]))