sbu-fsl / Metis

Metis: File System Model Checking via Versatile Input and State Exploration (FAST '24)
Apache License 2.0
11 stars 2 forks source link

Remove unnecessary null pointer checks #20

Open elfring opened 4 months ago

elfring commented 4 months ago

An extra null pointer check is not needed in functions like the following.

elfring commented 4 months ago

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