summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2018-06-14 17:03:20 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2018-06-14 17:03:20 +0000
commitb009f912c072b3f8cb4d41ce35ae3d94c4449aed (patch)
treeb5d44e37b1107889dfccac4a0804a2eaa4b03d0a /lib
parent5c5beb8f83fb9d91c1d3c430ac46957f1b20a3fb (diff)
Call DSA_SIG_new() instead of hand rolling the same.
ok beck@ tb@
Diffstat (limited to 'lib')
-rw-r--r--lib/libcrypto/dsa/dsa_asn1.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libcrypto/dsa/dsa_asn1.c b/lib/libcrypto/dsa/dsa_asn1.c
index aac67dbd034..23f08bb1f98 100644
--- a/lib/libcrypto/dsa/dsa_asn1.c
+++ b/lib/libcrypto/dsa/dsa_asn1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dsa_asn1.c,v 1.21 2018/02/20 17:48:35 tb Exp $ */
+/* $OpenBSD: dsa_asn1.c,v 1.22 2018/06/14 17:03:19 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
@@ -71,13 +71,10 @@ sig_cb(int operation, ASN1_VALUE **pval, const ASN1_ITEM *it, void *exarg)
if (operation == ASN1_OP_NEW_PRE) {
DSA_SIG *sig;
- sig = malloc(sizeof(DSA_SIG));
- if (!sig) {
+ if ((sig = DSA_SIG_new()) == NULL) {
DSAerror(ERR_R_MALLOC_FAILURE);
return 0;
}
- sig->r = NULL;
- sig->s = NULL;
*pval = (ASN1_VALUE *)sig;
return 2;
}