]> 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 02:04:36 +0000 (12:04 +1000)
bin/dig/dighost.c
lib/isc/mem.c

index a12ff400192b7dfa19720df579ade8bc60cbc255..7c720ea672a966bbe375ba8a68b95ef05f62f694 100644 (file)
@@ -1494,6 +1494,7 @@ save_opt(dig_lookup_t *lookup, char *code, char *value) {
        if (lookup->ednsopts == NULL) {
                cloneopts(lookup, NULL);
        }
+       INSIST(lookup->ednsopts != NULL);
 
        if (lookup->ednsopts[lookup->ednsoptscnt].value != NULL) {
                isc_mem_free(mctx, lookup->ednsopts[lookup->ednsoptscnt].value);
index f90c520540b7f27c745091d8e3bb0f8d502e21eb..ba58d02d1566d4dbc3e93ee571421de866f44c9a 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".