summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/asn1/asn1_lib.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/lib/libcrypto/asn1/asn1_lib.c b/src/lib/libcrypto/asn1/asn1_lib.c
index b04fa3c601..0998b41829 100644
--- a/src/lib/libcrypto/asn1/asn1_lib.c
+++ b/src/lib/libcrypto/asn1/asn1_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_lib.c,v 1.46 2021/11/13 20:44:00 schwarze Exp $ */ 1/* $OpenBSD: asn1_lib.c,v 1.47 2021/12/03 17:01:07 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -359,18 +359,15 @@ ASN1_STRING_new(void)
359ASN1_STRING * 359ASN1_STRING *
360ASN1_STRING_type_new(int type) 360ASN1_STRING_type_new(int type)
361{ 361{
362 ASN1_STRING *ret; 362 ASN1_STRING *a;
363 363
364 ret = malloc(sizeof(ASN1_STRING)); 364 if ((a = calloc(1, sizeof(ASN1_STRING))) == NULL) {
365 if (ret == NULL) {
366 ASN1error(ERR_R_MALLOC_FAILURE); 365 ASN1error(ERR_R_MALLOC_FAILURE);
367 return (NULL); 366 return NULL;
368 } 367 }
369 ret->length = 0; 368 a->type = type;
370 ret->type = type; 369
371 ret->data = NULL; 370 return a;
372 ret->flags = 0;
373 return (ret);
374} 371}
375 372
376void 373void