]> 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>
Wed, 5 Apr 2023 00:27:52 +0000 (10:27 +1000)
'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);

(cherry picked from commit 8c5539e905aec0e91e0bb1b390be8edb2e558c11)

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

index 06cd3a7b54fc5a2e5f9b71b1d5b0535ca18ddc31..8556cb75d0bdc3845ccf76d5726ba991196d7806 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 6a17f18038351ba7e67bc0748a5a3627945c3978..1ec1fd85729feee5795b8130e06fa17c08f435e8 100644 (file)
@@ -361,7 +361,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);
        }