]> git.ipfire.org Git - thirdparty/lldpd.git/commit
style: remove `if (...) free(...)` pattern
authorVincent Bernat <vincent@bernat.im>
Mon, 23 Mar 2015 20:35:03 +0000 (21:35 +0100)
committerVincent Bernat <vincent@bernat.im>
Mon, 23 Mar 2015 20:35:03 +0000 (21:35 +0100)
commit81b171f473218aecf94b601d03bff2be7705c58d
treedb4f188725de252fb70943a5974e27904ae61560
parent4db5e8c68d9a01cb121e69f2c7e67d8ac3d623bb
style: remove `if (...) free(...)` pattern

Using the following Coccinelle patch:

    @@
    expression ptr;
    @@

    - if (ptr) {
    -   free(ptr);
    - }
    + free(ptr);

    @@
    expression ptr;
    @@

    - if (ptr) free(ptr);
    + free(ptr);

    @@
    expression ptr;
    @@

    - if (ptr != NULL) {
    -   free(ptr);
    - }
    + free(ptr);

    @@
    expression ptr;
    @@

    - if (ptr != NULL) free(ptr);
    + free(ptr);
src/lib/atom-private.c
tests/check_snmp.c