CLEANUP: Do not use a fixed type for 'sizeof' in 'calloc'
authorTim Duesterhus <tim@bastelstu.be>
Sat, 12 Sep 2020 18:26:43 +0000 (20:26 +0200)
committerWilly Tarreau <w@1wt.eu>
Sat, 12 Sep 2020 18:31:25 +0000 (20:31 +0200)
commite52b6e5456d82e8105a3cd18e4dfdccb776e319f
treefd68a18fa784827c556b58a62f5a091d4491fed6
parentb53dd03dc04eb4842fd094747798ef763cd3daba
CLEANUP: Do not use a fixed type for 'sizeof' in 'calloc'

Changes performed using the following coccinelle patch:

    @@
    type T;
    expression E;
    expression t;
    @@

    (
      t = calloc(E, sizeof(*t))
    |
    - t = calloc(E, sizeof(T))
    + t = calloc(E, sizeof(*t))
    )

Looking through the commit history, grepping for coccinelle shows that the same
replacement with a different patch was already performed in the past in commit
02779b6263a177b1e462e53db6eaf57bcda574bc.
13 files changed:
src/51d.c
src/arg.c
src/cfgparse-listen.c
src/check.c
src/extcheck.c
src/fd.c
src/haproxy.c
src/hlua.c
src/lb_chash.c
src/lb_map.c
src/ssl_sock.c
src/tools.c
src/uri_auth.c