summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/a_bitstr.c
diff options
context:
space:
mode:
authorDr. David von Oheimb <David.von.Oheimb@siemens.com>2022-06-28 08:17:59 +0200
committerDr. David von Oheimb <dev@ddvo.net>2022-07-19 08:44:19 +0200
commit33847508d5605d8dbe868d7694a4eff79d785404 (patch)
tree7cb02368d3058f88e67ea4dcda88718e839b9018 /crypto/asn1/a_bitstr.c
parent9df71587f1897c3b282b3fe1b47c01656b58531e (diff)
libcrypto refactoring: make more use of ASN1_STRING_set0()
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Shane Lontis <shane.lontis@oracle.com> Reviewed-by: David von Oheimb <david.von.oheimb@siemens.com> (Merged from https://github.com/openssl/openssl/pull/18668)
Diffstat (limited to 'crypto/asn1/a_bitstr.c')
-rw-r--r--crypto/asn1/a_bitstr.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/crypto/asn1/a_bitstr.c b/crypto/asn1/a_bitstr.c
index 7c25649357..f8938ad107 100644
--- a/crypto/asn1/a_bitstr.c
+++ b/crypto/asn1/a_bitstr.c
@@ -125,9 +125,7 @@ ASN1_BIT_STRING *ossl_c2i_ASN1_BIT_STRING(ASN1_BIT_STRING **a,
} else
s = NULL;
- ret->length = (int)len;
- OPENSSL_free(ret->data);
- ret->data = s;
+ ASN1_STRING_set0(ret, s, (int)len);
ret->type = V_ASN1_BIT_STRING;
if (a != NULL)
(*a) = ret;