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);

(cherry picked from commit 8c5539e905)
This commit is contained in:
Mark Andrews
2023-04-04 11:01:36 +10:00
parent 09e0c5f14a
commit bb705e9a90
2 changed files with 2 additions and 2 deletions

View 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);
}

View 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);
}