summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1/x_algor.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1/x_algor.c')
-rw-r--r--src/lib/libcrypto/asn1/x_algor.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c
index 6f6fbb112a..7ae473485c 100644
--- a/src/lib/libcrypto/asn1/x_algor.c
+++ b/src/lib/libcrypto/asn1/x_algor.c
@@ -81,25 +81,21 @@ int X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval)
81{ 81{
82 if (!alg) 82 if (!alg)
83 return 0; 83 return 0;
84 if (ptype != V_ASN1_UNDEF) 84 if (ptype != V_ASN1_UNDEF) {
85 {
86 if (alg->parameter == NULL) 85 if (alg->parameter == NULL)
87 alg->parameter = ASN1_TYPE_new(); 86 alg->parameter = ASN1_TYPE_new();
88 if (alg->parameter == NULL) 87 if (alg->parameter == NULL)
89 return 0; 88 return 0;
90 } 89 }
91 if (alg) 90 if (alg) {
92 {
93 if (alg->algorithm) 91 if (alg->algorithm)
94 ASN1_OBJECT_free(alg->algorithm); 92 ASN1_OBJECT_free(alg->algorithm);
95 alg->algorithm = aobj; 93 alg->algorithm = aobj;
96 } 94 }
97 if (ptype == 0) 95 if (ptype == 0)
98 return 1; 96 return 1;
99 if (ptype == V_ASN1_UNDEF) 97 if (ptype == V_ASN1_UNDEF) {
100 { 98 if (alg->parameter) {
101 if (alg->parameter)
102 {
103 ASN1_TYPE_free(alg->parameter); 99 ASN1_TYPE_free(alg->parameter);
104 alg->parameter = NULL; 100 alg->parameter = NULL;
105 } 101 }
@@ -114,10 +110,8 @@ void X509_ALGOR_get0(ASN1_OBJECT **paobj, int *pptype, void **ppval,
114{ 110{
115 if (paobj) 111 if (paobj)
116 *paobj = algor->algorithm; 112 *paobj = algor->algorithm;
117 if (pptype) 113 if (pptype) {
118 { 114 if (algor->parameter == NULL) {
119 if (algor->parameter == NULL)
120 {
121 *pptype = V_ASN1_UNDEF; 115 *pptype = V_ASN1_UNDEF;
122 return; 116 return;
123 } 117 }