From: Mark Andrews Date: Thu, 25 Jun 2020 00:45:02 +0000 (+1000) Subject: Add INSIST's to silence cppcheck warnings X-Git-Tag: v9.17.3~38^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0cf25d7f3820b3cbe266998f8e11ceb21b28908c;p=thirdparty%2Fbind9.git Add INSIST's to silence cppcheck warnings --- diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index a12ff400192..7c720ea672a 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -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); diff --git a/lib/isc/mem.c b/lib/isc/mem.c index f90c520540b..ba58d02d156 100644 --- a/lib/isc/mem.c +++ b/lib/isc/mem.c @@ -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".