summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/asn1_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/asn1/asn1_lib.c')
-rw-r--r--crypto/asn1/asn1_lib.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/crypto/asn1/asn1_lib.c b/crypto/asn1/asn1_lib.c
index 9dfe395399..8ca53b4ce4 100644
--- a/crypto/asn1/asn1_lib.c
+++ b/crypto/asn1/asn1_lib.c
@@ -11,6 +11,7 @@
#include <limits.h>
#include "internal/cryptlib.h"
#include <openssl/asn1.h>
+#include "asn1_locl.h"
static int asn1_get_length(const unsigned char **pp, int *inf, long *rl,
long max);
@@ -314,16 +315,23 @@ ASN1_STRING *ASN1_STRING_type_new(int type)
return (ret);
}
-void ASN1_STRING_free(ASN1_STRING *a)
+void asn1_string_embed_free(ASN1_STRING *a, int embed)
{
if (a == NULL)
return;
if (!(a->flags & ASN1_STRING_FLAG_NDEF))
OPENSSL_free(a->data);
- if (!(a->flags & ASN1_STRING_FLAG_EMBED))
+ if (embed == 0)
OPENSSL_free(a);
}
+void ASN1_STRING_free(ASN1_STRING *a)
+{
+ if (a == NULL)
+ return;
+ asn1_string_embed_free(a, a->flags & ASN1_STRING_FLAG_EMBED);
+}
+
void ASN1_STRING_clear_free(ASN1_STRING *a)
{
if (a == NULL)