]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Remove 'inst != NULL' from cleanup check in plugin_register
authorMark Andrews <marka@isc.org>
Tue, 4 Apr 2023 01:01:36 +0000 (11:01 +1000)
committerMark Andrews <marka@isc.org>
Tue, 4 Apr 2023 23:51:22 +0000 (23:51 +0000)
'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);

bin/plugins/filter-a.c
bin/plugins/filter-aaaa.c

index 4836110238f02dd7f58ad872c0a5143b98142d67..9ee1e9f374a20bfafb5bfc0eb98380fe64230225 100644 (file)
@@ -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);
        }
 
index 9a1c62a57e7e86c0fd917b22a3a5ada4a27ba2ad..9830639938003d10908a1c732a163840bf074814 100644 (file)
@@ -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);
        }