]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Add INSIST's to silence cppcheck warnings
authorMark Andrews <marka@isc.org>
Thu, 25 Jun 2020 00:45:02 +0000 (10:45 +1000)
committerMark Andrews <marka@isc.org>
Thu, 25 Jun 2020 11:13:17 +0000 (21:13 +1000)
(cherry picked from commit 0cf25d7f3820b3cbe266998f8e11ceb21b28908c)

lib/isc/mem.c

index 5e4b3d10046c7793b5fa66420db660b168bb93a0..1a90e780ee5533a4c02ab5a9c7755c7a47588b91 100644 (file)
@@ -445,6 +445,7 @@ more_frags(isc__mem_t *ctx, size_t new_size) {
        if (ctx->basic_blocks == NULL) {
                more_basic_blocks(ctx);
        }
+       INSIST(ctx->basic_blocks != NULL);
 
        total_size = ctx->mem_target;
        tmp = ctx->basic_blocks;
@@ -516,6 +517,7 @@ mem_getunlocked(isc__mem_t *ctx, size_t size) {
        if (ctx->freelists[new_size] == NULL) {
                more_frags(ctx, new_size);
        }
+       INSIST(ctx->freelists[new_size] != NULL);
 
        /*
         * The free list uses the "rounded-up" size "new_size".