From: Mark Andrews Date: Sun, 26 Oct 2025 23:35:35 +0000 (+1100) Subject: Remove unnecessary NULL checks in parser.c X-Git-Tag: v9.21.15~31^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3594ad04e539acc468343472a831919212f58ee7;p=thirdparty%2Fbind9.git Remove unnecessary NULL checks in parser.c In cfg_parse_buffer and cfg_parse_file 'pctx' was being checked for being non-NULL when it was guarenteed to be non-NULL. This raised Coverity issues ID 637688 and ID 637689. --- diff --git a/lib/isccfg/parser.c b/lib/isccfg/parser.c index f5e2dbffd93..011d8305137 100644 --- a/lib/isccfg/parser.c +++ b/lib/isccfg/parser.c @@ -675,9 +675,7 @@ cfg_parse_file(isc_mem_t *mctx, const char *filename, const cfg_type_t *type, ISC_LIST_APPEND(pctx->closed_files->value.list, elt, link); cleanup: - if (pctx != NULL) { - parser_destroy(&pctx); - } + parser_destroy(&pctx); return result; } @@ -709,9 +707,7 @@ cfg_parse_buffer(isc_mem_t *mctx, isc_buffer_t *buffer, const char *file, pctx->buf_name = NULL; cleanup: - if (pctx != NULL) { - parser_destroy(&pctx); - } + parser_destroy(&pctx); return result; }