]> granicus.if.org Git - curl/commit
all: Refactor malloc+memset to use calloc
authorDaniel Gustafsson <daniel@yesql.se>
Sat, 14 Apr 2018 20:42:04 +0000 (22:42 +0200)
committerJay Satiro <raysatiro@yahoo.com>
Sun, 15 Apr 2018 07:00:37 +0000 (03:00 -0400)
commit94400f32e9016d2eaea2db583f6e213c36b1eb1d
treed8c79e652dfa3a9b52b0056cdbe00a66411a502b
parent2b126cd7083ddf1308ebc447cabd1983b16a99fa
all: Refactor malloc+memset to use calloc

When a zeroed out allocation is required, use calloc() rather than
malloc() followed by an explicit memset(). The result will be the
same, but using calloc() everywhere increases consistency in the
codebase and avoids the risk of subtle bugs when code is injected
between malloc and memset by accident.

Closes https://github.com/curl/curl/pull/2497
13 files changed:
docs/examples/evhiperfifo.c
docs/examples/fopen.c
docs/examples/hiperfifo.c
lib/content_encoding.c
lib/curl_ntlm_core.c
lib/nwlib.c
lib/vauth/krb5_sspi.c
lib/vauth/ntlm_sspi.c
lib/vauth/spnego_sspi.c
lib/vtls/polarssl.c
lib/vtls/schannel.c
src/tool_formparse.c
tests/server/sockfilt.c