From: Ondřej Surý Date: Thu, 29 Sep 2022 08:46:36 +0000 (+0200) Subject: Add missing DbC check for name##_detach in ISC_REFCOUNT_IMPL macro X-Git-Tag: v9.19.6~19^2~3 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1e2ededb07844d2d1d361a27f9181013aac4e1fd;p=thirdparty%2Fbind9.git Add missing DbC check for name##_detach in ISC_REFCOUNT_IMPL macro The detach function in the ISC_REFCOUNT_IMPL macro was missing DbC checks, add them. --- diff --git a/lib/isc/include/isc/refcount.h b/lib/isc/include/isc/refcount.h index bf0a66e32b8..e33cd7df25b 100644 --- a/lib/isc/include/isc/refcount.h +++ b/lib/isc/include/isc/refcount.h @@ -174,6 +174,7 @@ isc_refcount_decrement(isc_refcount_t *target) { } \ \ void name##_detach(name##_t **ptrp) { \ + REQUIRE(ptrp != NULL && *ptrp != NULL); \ name##_t *ptr = *ptrp; \ *ptrp = NULL; \ name##_unref(ptr); \