diff options
author | Joel Sing <jsing@cvs.openbsd.org> | 2018-06-14 17:01:50 +0000 |
---|---|---|
committer | Joel Sing <jsing@cvs.openbsd.org> | 2018-06-14 17:01:50 +0000 |
commit | 5c5beb8f83fb9d91c1d3c430ac46957f1b20a3fb (patch) | |
tree | d94a3d01251fcf9b275b4c0f658666551f996b1e /lib | |
parent | 27a5008cc2bc7e86b58eda8d6a8e0f59e8272a32 (diff) |
DSA_SIG_new() amounts to a single calloc() call.
ok beck@ tb@
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcrypto/dsa/dsa_sign.c | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/lib/libcrypto/dsa/dsa_sign.c b/lib/libcrypto/dsa/dsa_sign.c index 355bdd20d6f..0f55ea1868c 100644 --- a/lib/libcrypto/dsa/dsa_sign.c +++ b/lib/libcrypto/dsa/dsa_sign.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsa_sign.c,v 1.19 2014/10/18 17:20:40 jsing Exp $ */ +/* $OpenBSD: dsa_sign.c,v 1.20 2018/06/14 17:01:49 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -76,20 +76,13 @@ DSA_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, BIGNUM **rp) DSA_SIG * DSA_SIG_new(void) { - DSA_SIG *sig; - - sig = malloc(sizeof(DSA_SIG)); - if (!sig) - return NULL; - sig->r = NULL; - sig->s = NULL; - return sig; + return calloc(1, sizeof(DSA_SIG)); } void DSA_SIG_free(DSA_SIG *sig) { - if (sig) { + if (sig != NULL) { BN_free(sig->r); BN_free(sig->s); free(sig); |