Skip to content

Remove an unnecessary null pointer check #146

@Yogaraj-Alamenda

Description

@Yogaraj-Alamenda

Is it from the code review you figured out

Yes.

👀 A source code search can help also by the means of the GitHub interface.

or through some static analysis.

💭 I am curious if another software developer (besides me) can get into the mood to apply a corresponding update suggestion which could be generated by the software “Coccinelle” (also with the help of a variant from the following script).

@Remove_unnecessary_pointer_checks@
expression x;
@@
-if (\(x != 0 \| x != NULL\))
    free(x);

Originally posted by @elfring in #126

Why were further update candidates left over? 🤔

QATzip/src/qatzip.c

Lines 470 to 477 in aec427a

if (NULL != g_process.dc_inst_handle) {
free(g_process.dc_inst_handle);
g_process.dc_inst_handle = NULL;
}
if (NULL != g_process.qz_inst) {
free(g_process.qz_inst);
g_process.qz_inst = NULL;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions