From: Mark Andrews Date: Thu, 17 Jan 2013 03:15:28 +0000 (+1100) Subject: Silence "Use of memory after it is freed" by asserting the head and tail of list... X-Git-Tag: v9.10.0a1~568 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=d710475e18cd32b02657dafa4c7a34cacb738e29;p=thirdparty%2Fbind9.git 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. --- diff --git a/lib/isc/include/isc/list.h b/lib/isc/include/isc/list.h index c9bdfc7ad6b..508f9fe6a0c 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) \