From: Rose <83477269+AtariDreams@users.noreply.github.com> Date: Sun, 4 Jun 2023 17:41:02 +0000 (-0400) Subject: Prefer calloc over malloc X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/9b97f85e62fb236e65e659cabad5c0f62bfae105 Prefer calloc over malloc This makes the code cleaner anyway and avoids branching. --- diff --git a/print-esp.c b/print-esp.c index 560d3b94..e8c1be4b 100644 --- a/print-esp.c +++ b/print-esp.c @@ -132,10 +132,7 @@ EVP_CIPHER_CTX_new(void) { EVP_CIPHER_CTX *ctx; - ctx = malloc(sizeof(*ctx)); - if (ctx == NULL) - return (NULL); - memset(ctx, 0, sizeof(*ctx)); + ctx = calloc(1, sizeof(*ctx)); return (ctx); }