diff options
Diffstat (limited to 'src/lib/libcrypto/ts/ts_verify_ctx.c')
| -rw-r--r-- | src/lib/libcrypto/ts/ts_verify_ctx.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libcrypto/ts/ts_verify_ctx.c b/src/lib/libcrypto/ts/ts_verify_ctx.c index 3fc772678c..e0803e9af9 100644 --- a/src/lib/libcrypto/ts/ts_verify_ctx.c +++ b/src/lib/libcrypto/ts/ts_verify_ctx.c | |||
| @@ -63,12 +63,11 @@ | |||
| 63 | TS_VERIFY_CTX * | 63 | TS_VERIFY_CTX * |
| 64 | TS_VERIFY_CTX_new(void) | 64 | TS_VERIFY_CTX_new(void) |
| 65 | { | 65 | { |
| 66 | TS_VERIFY_CTX *ctx = (TS_VERIFY_CTX *) malloc(sizeof(TS_VERIFY_CTX)); | 66 | TS_VERIFY_CTX *ctx = calloc(1, sizeof(TS_VERIFY_CTX)); |
| 67 | 67 | ||
| 68 | if (ctx) | 68 | if (!ctx) |
| 69 | memset(ctx, 0, sizeof(TS_VERIFY_CTX)); | ||
| 70 | else | ||
| 71 | TSerr(TS_F_TS_VERIFY_CTX_NEW, ERR_R_MALLOC_FAILURE); | 69 | TSerr(TS_F_TS_VERIFY_CTX_NEW, ERR_R_MALLOC_FAILURE); |
| 70 | |||
| 72 | return ctx; | 71 | return ctx; |
| 73 | } | 72 | } |
| 74 | 73 | ||
