From: Mark Andrews Date: Tue, 4 Apr 2023 01:01:36 +0000 (+1000) Subject: Remove 'inst != NULL' from cleanup check in plugin_register X-Git-Tag: v9.19.12~14^2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c5539e905aec0e91e0bb1b390be8edb2e558c11;p=thirdparty%2Fbind9.git Remove 'inst != NULL' from cleanup check in plugin_register 'inst' is guarenteed to be non NULL at this point. 358 *instp = inst; 359 360cleanup: CID 281450 (#2 of 2): Dereference before null check (REVERSE_INULL) check_after_deref: Null-checking inst suggests that it may be null, but it has already been dereferenced on all paths leading to the check. 361 if (result != ISC_R_SUCCESS && inst != NULL) { 362 plugin_destroy((void **)&inst); 363 } 364 365 return (result); --- diff --git a/bin/plugins/filter-a.c b/bin/plugins/filter-a.c index 4836110238f..9ee1e9f374a 100644 --- a/bin/plugins/filter-a.c +++ b/bin/plugins/filter-a.c @@ -358,7 +358,7 @@ plugin_register(const char *parameters, const void *cfg, const char *cfg_file, *instp = inst; cleanup: - if (result != ISC_R_SUCCESS && inst != NULL) { + if (result != ISC_R_SUCCESS) { plugin_destroy((void **)&inst); } diff --git a/bin/plugins/filter-aaaa.c b/bin/plugins/filter-aaaa.c index 9a1c62a57e7..98306399380 100644 --- a/bin/plugins/filter-aaaa.c +++ b/bin/plugins/filter-aaaa.c @@ -362,7 +362,7 @@ plugin_register(const char *parameters, const void *cfg, const char *cfg_file, *instp = inst; cleanup: - if (result != ISC_R_SUCCESS && inst != NULL) { + if (result != ISC_R_SUCCESS) { plugin_destroy((void **)&inst); }