Skip to content

Commit 9b97f85

Browse files
Roseinfrastation
authored andcommitted
Prefer calloc over malloc
This makes the code cleaner anyway and avoids branching.
1 parent 5a25aed commit 9b97f85

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

print-esp.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,7 @@ EVP_CIPHER_CTX_new(void)
132132
{
133133
EVP_CIPHER_CTX *ctx;
134134

135-
ctx = malloc(sizeof(*ctx));
136-
if (ctx == NULL)
137-
return (NULL);
138-
memset(ctx, 0, sizeof(*ctx));
135+
ctx = calloc(1, sizeof(*ctx));
139136
return (ctx);
140137
}
141138

0 commit comments

Comments
 (0)