summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/x509/x509_trs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/x509/x509_trs.c')
-rw-r--r--src/lib/libcrypto/x509/x509_trs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/x509/x509_trs.c b/src/lib/libcrypto/x509/x509_trs.c
index a6cb9c8b1b..7bb5094e64 100644
--- a/src/lib/libcrypto/x509/x509_trs.c
+++ b/src/lib/libcrypto/x509/x509_trs.c
@@ -169,15 +169,15 @@ int X509_TRUST_add(int id, int flags, int (*ck)(X509_TRUST *, X509 *, int),
169 idx = X509_TRUST_get_by_id(id); 169 idx = X509_TRUST_get_by_id(id);
170 /* Need a new entry */ 170 /* Need a new entry */
171 if(idx == -1) { 171 if(idx == -1) {
172 if(!(trtmp = OPENSSL_malloc(sizeof(X509_TRUST)))) { 172 if(!(trtmp = malloc(sizeof(X509_TRUST)))) {
173 X509err(X509_F_X509_TRUST_ADD,ERR_R_MALLOC_FAILURE); 173 X509err(X509_F_X509_TRUST_ADD,ERR_R_MALLOC_FAILURE);
174 return 0; 174 return 0;
175 } 175 }
176 trtmp->flags = X509_TRUST_DYNAMIC; 176 trtmp->flags = X509_TRUST_DYNAMIC;
177 } else trtmp = X509_TRUST_get0(idx); 177 } else trtmp = X509_TRUST_get0(idx);
178 178
179 /* OPENSSL_free existing name if dynamic */ 179 /* free existing name if dynamic */
180 if(trtmp->flags & X509_TRUST_DYNAMIC_NAME) OPENSSL_free(trtmp->name); 180 if(trtmp->flags & X509_TRUST_DYNAMIC_NAME) free(trtmp->name);
181 /* dup supplied name */ 181 /* dup supplied name */
182 if(!(trtmp->name = BUF_strdup(name))) { 182 if(!(trtmp->name = BUF_strdup(name))) {
183 X509err(X509_F_X509_TRUST_ADD,ERR_R_MALLOC_FAILURE); 183 X509err(X509_F_X509_TRUST_ADD,ERR_R_MALLOC_FAILURE);
@@ -213,8 +213,8 @@ static void trtable_free(X509_TRUST *p)
213 if (p->flags & X509_TRUST_DYNAMIC) 213 if (p->flags & X509_TRUST_DYNAMIC)
214 { 214 {
215 if (p->flags & X509_TRUST_DYNAMIC_NAME) 215 if (p->flags & X509_TRUST_DYNAMIC_NAME)
216 OPENSSL_free(p->name); 216 free(p->name);
217 OPENSSL_free(p); 217 free(p);
218 } 218 }
219 } 219 }
220 220