types_list.c: fix two resource leaks