When compiled with ASAN: -O1 -fsanitize=address -fno-omit-frame-pointer,
the following issue is seen:
==14272==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 1072 byte(s) in 1 object(s) allocated from:
#0 0x7f0180966d28 in __interceptor_calloc (/usr/lib/x86_64-linux-gnu/libasan.so.4+0xded28)
#1 0x7f018039f043 in pa_xmalloc0 pulse/xmalloc.c:74
#2 0x7f01803c5cc8 in pa_hashmap_new_full pulsecore/hashmap.c:61
#3 0x7f01803c5df9 in pa_hashmap_new pulsecore/hashmap.c:76
#4 0x556ee75ff7f4 in remove_all_test tests/hashmap-test.c:96
#5 0x556ee7602965 in srunner_run (/home/eenurkka/pulse/pulseaudio/src/.libs/hashmap-test+0x6965)
SUMMARY: AddressSanitizer: 1072 byte(s) leaked in 1 allocation(s).
Fix it by freeing the resource properly.
Signed-off-by: Eero Nurkkala <eero.nurkkala@offcode.fi>
if ((size = pa_hashmap_size(map)) != 0) {
ck_abort_msg("Hashmap has wrong size; got %u, want 0", size);
}
+
+ pa_hashmap_free(map);
}
END_TEST