From d710475e18cd32b02657dafa4c7a34cacb738e29 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 17 Jan 2013 14:15:28 +1100 Subject: [PATCH] Silence "Use of memory after it is freed" by asserting the head and tail of list are not the element after it is unlinked from the list. --- lib/isc/include/isc/list.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/isc/include/isc/list.h b/lib/isc/include/isc/list.h index c9bdfc7ad6..508f9fe6a0 100644 --- a/lib/isc/include/isc/list.h +++ b/lib/isc/include/isc/list.h @@ -102,6 +102,8 @@ } \ (elt)->link.prev = (type *)(-1); \ (elt)->link.next = (type *)(-1); \ + ISC_INSIST((list).head != (elt)); \ + ISC_INSIST((list).head != (elt)); \ } while (0) #define __ISC_LIST_UNLINKUNSAFE(list, elt, link) \