summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/asn1
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/asn1')
-rw-r--r--src/lib/libcrypto/asn1/a_object.c8
-rw-r--r--src/lib/libcrypto/asn1/asn1_par.c11
-rw-r--r--src/lib/libcrypto/asn1/evp_asn1.c8
-rw-r--r--src/lib/libcrypto/asn1/x_pkey.c8
-rw-r--r--src/lib/libcrypto/asn1/x_pubkey.c5
5 files changed, 15 insertions, 25 deletions
diff --git a/src/lib/libcrypto/asn1/a_object.c b/src/lib/libcrypto/asn1/a_object.c
index 551aece6ad..863aa6a226 100644
--- a/src/lib/libcrypto/asn1/a_object.c
+++ b/src/lib/libcrypto/asn1/a_object.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: a_object.c,v 1.21 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: a_object.c,v 1.22 2014/07/12 16:03:36 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -206,15 +206,13 @@ a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num)
206 } 206 }
207 if (tmp != ftmp) 207 if (tmp != ftmp)
208 free(tmp); 208 free(tmp);
209 if (bl) 209 BN_free(bl);
210 BN_free(bl);
211 return (len); 210 return (len);
212 211
213err: 212err:
214 if (tmp != ftmp) 213 if (tmp != ftmp)
215 free(tmp); 214 free(tmp);
216 if (bl) 215 BN_free(bl);
217 BN_free(bl);
218 return (0); 216 return (0);
219} 217}
220 218
diff --git a/src/lib/libcrypto/asn1/asn1_par.c b/src/lib/libcrypto/asn1/asn1_par.c
index c6f95c42ab..f5e3a8b529 100644
--- a/src/lib/libcrypto/asn1/asn1_par.c
+++ b/src/lib/libcrypto/asn1/asn1_par.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1_par.c,v 1.19 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: asn1_par.c,v 1.20 2014/07/12 16:03:36 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -291,10 +291,8 @@ asn1_parse2(BIO *bp, const unsigned char **pp, long length, int offset,
291 nl = 1; 291 nl = 1;
292 } 292 }
293 } 293 }
294 if (os != NULL) { 294 M_ASN1_OCTET_STRING_free(os);
295 M_ASN1_OCTET_STRING_free(os); 295 os = NULL;
296 os = NULL;
297 }
298 } else if (tag == V_ASN1_INTEGER) { 296 } else if (tag == V_ASN1_INTEGER) {
299 ASN1_INTEGER *bs; 297 ASN1_INTEGER *bs;
300 int i; 298 int i;
@@ -376,8 +374,7 @@ asn1_parse2(BIO *bp, const unsigned char **pp, long length, int offset,
376end: 374end:
377 if (o != NULL) 375 if (o != NULL)
378 ASN1_OBJECT_free(o); 376 ASN1_OBJECT_free(o);
379 if (os != NULL) 377 M_ASN1_OCTET_STRING_free(os);
380 M_ASN1_OCTET_STRING_free(os);
381 *pp = p; 378 *pp = p;
382 return (ret); 379 return (ret);
383} 380}
diff --git a/src/lib/libcrypto/asn1/evp_asn1.c b/src/lib/libcrypto/asn1/evp_asn1.c
index 199c12f9a4..5e21f3c8ae 100644
--- a/src/lib/libcrypto/asn1/evp_asn1.c
+++ b/src/lib/libcrypto/asn1/evp_asn1.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: evp_asn1.c,v 1.12 2014/07/11 13:41:59 miod Exp $ */ 1/* $OpenBSD: evp_asn1.c,v 1.13 2014/07/12 16:03:36 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -193,9 +193,7 @@ err:
193 ASN1err(ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING, 193 ASN1err(ASN1_F_ASN1_TYPE_GET_INT_OCTETSTRING,
194 ASN1_R_DATA_IS_WRONG); 194 ASN1_R_DATA_IS_WRONG);
195 } 195 }
196 if (os != NULL) 196 M_ASN1_OCTET_STRING_free(os);
197 M_ASN1_OCTET_STRING_free(os); 197 M_ASN1_INTEGER_free(ai);
198 if (ai != NULL)
199 M_ASN1_INTEGER_free(ai);
200 return (ret); 198 return (ret);
201} 199}
diff --git a/src/lib/libcrypto/asn1/x_pkey.c b/src/lib/libcrypto/asn1/x_pkey.c
index a5134bc6a2..d454afb72b 100644
--- a/src/lib/libcrypto/asn1/x_pkey.c
+++ b/src/lib/libcrypto/asn1/x_pkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_pkey.c,v 1.14 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: x_pkey.c,v 1.15 2014/07/12 16:03:36 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -149,10 +149,8 @@ X509_PKEY_free(X509_PKEY *x)
149 149
150 if (x->enc_algor != NULL) 150 if (x->enc_algor != NULL)
151 X509_ALGOR_free(x->enc_algor); 151 X509_ALGOR_free(x->enc_algor);
152 if (x->enc_pkey != NULL) 152 M_ASN1_OCTET_STRING_free(x->enc_pkey);
153 M_ASN1_OCTET_STRING_free(x->enc_pkey); 153 EVP_PKEY_free(x->dec_pkey);
154 if (x->dec_pkey != NULL)
155 EVP_PKEY_free(x->dec_pkey);
156 if ((x->key_data != NULL) && (x->key_free)) 154 if ((x->key_data != NULL) && (x->key_free))
157 free(x->key_data); 155 free(x->key_data);
158 free(x); 156 free(x);
diff --git a/src/lib/libcrypto/asn1/x_pubkey.c b/src/lib/libcrypto/asn1/x_pubkey.c
index 87cb25bb50..56cc63059a 100644
--- a/src/lib/libcrypto/asn1/x_pubkey.c
+++ b/src/lib/libcrypto/asn1/x_pubkey.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_pubkey.c,v 1.21 2014/07/11 08:44:47 jsing Exp $ */ 1/* $OpenBSD: x_pubkey.c,v 1.22 2014/07/12 16:03:36 miod Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -183,8 +183,7 @@ X509_PUBKEY_get(X509_PUBKEY *key)
183 return ret; 183 return ret;
184 184
185error: 185error:
186 if (ret != NULL) 186 EVP_PKEY_free(ret);
187 EVP_PKEY_free(ret);
188 return (NULL); 187 return (NULL);
189} 188}
190 189