merge of 2cc527e6d8c8ff19dab478f7d12e58f1cfa6d6f5
     and 7b542932f3e2947183b45bdbf39d448f457da9fd
diff --git a/tests/find-prologues.c b/tests/find-prologues.c
index ad668cd..2e2fd0e 100644
--- a/tests/find-prologues.c
+++ b/tests/find-prologues.c
@@ -98,5 +98,7 @@
   while ((a.cu = dwfl_nextcu (a.dwfl, a.cu, &a.dwbias)) != NULL)
     dwarf_getfuncs (a.cu, &handle_function, &a, 0);
 
+  dwfl_end (a.dwfl);
+
   return result;
 }