]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add missing DbC check for name##_detach in ISC_REFCOUNT_IMPL macro
authorOndřej Surý <ondrej@isc.org>
Thu, 29 Sep 2022 08:46:36 +0000 (10:46 +0200)
committerOndřej Surý <ondrej@isc.org>
Fri, 30 Sep 2022 07:50:17 +0000 (09:50 +0200)
The detach function in the ISC_REFCOUNT_IMPL macro was missing DbC
checks, add them.

lib/isc/include/isc/refcount.h

index bf0a66e32b8d83d07ae8c3b2c6b7f55ac71111f3..e33cd7df25b70cd7aa0f1ba82b7b47f9d58f4382 100644 (file)
@@ -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);                                   \