summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/x_algor.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/asn1/x_algor.c')
-rw-r--r--crypto/asn1/x_algor.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/crypto/asn1/x_algor.c b/crypto/asn1/x_algor.c
index e13daf849b..2046d8f3cf 100644
--- a/crypto/asn1/x_algor.c
+++ b/crypto/asn1/x_algor.c
@@ -110,13 +110,17 @@ int X509_ALGOR_copy(X509_ALGOR *dest, const X509_ALGOR *src)
if ((dest->algorithm = OBJ_dup(src->algorithm)) == NULL)
return 0;
- if (src->parameter)
+ if (src->parameter) {
+ dest->parameter = ASN1_TYPE_new();
+ if (dest->parameter == NULL)
+ return 0;
+
/* Assuming this is also correct for a BOOL.
* set does copy as a side effect.
*/
if (ASN1_TYPE_set1(dest->parameter,
- src->parameter->type, src->parameter->value.ptr) == 0)
- return 0;
-
+ src->parameter->type, src->parameter->value.ptr) == 0)
+ return 0;
+ }
return 1;
}