diff options
author | Daniel Gustafsson <daniel@yesql.se> | 2018-04-14 22:42:04 +0200 |
---|---|---|
committer | Jay Satiro <raysatiro@yahoo.com> | 2018-04-15 03:00:37 -0400 |
commit | 94400f32e9016d2eaea2db583f6e213c36b1eb1d (patch) | |
tree | d8c79e652dfa3a9b52b0056cdbe00a66411a502b /docs/examples/hiperfifo.c | |
parent | 2b126cd7083ddf1308ebc447cabd1983b16a99fa (diff) | |
download | gnurl-94400f32e9016d2eaea2db583f6e213c36b1eb1d.tar.gz gnurl-94400f32e9016d2eaea2db583f6e213c36b1eb1d.tar.bz2 gnurl-94400f32e9016d2eaea2db583f6e213c36b1eb1d.zip |
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
Diffstat (limited to 'docs/examples/hiperfifo.c')
-rw-r--r-- | docs/examples/hiperfifo.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/docs/examples/hiperfifo.c b/docs/examples/hiperfifo.c index 7794283c6..fec62b85f 100644 --- a/docs/examples/hiperfifo.c +++ b/docs/examples/hiperfifo.c @@ -339,7 +339,6 @@ static void new_conn(char *url, GlobalInfo *g) CURLMcode rc; conn = calloc(1, sizeof(ConnInfo)); - memset(conn, 0, sizeof(ConnInfo)); conn->error[0]='\0'; conn->easy = curl_easy_init(); |