summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ec/ec_ameth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/ec/ec_ameth.c')
-rw-r--r--src/lib/libcrypto/ec/ec_ameth.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c
index 0ce4524076..6331903141 100644
--- a/src/lib/libcrypto/ec/ec_ameth.c
+++ b/src/lib/libcrypto/ec/ec_ameth.c
@@ -116,7 +116,7 @@ static int eckey_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
116 penclen = i2o_ECPublicKey(ec_key, NULL); 116 penclen = i2o_ECPublicKey(ec_key, NULL);
117 if (penclen <= 0) 117 if (penclen <= 0)
118 goto err; 118 goto err;
119 penc = OPENSSL_malloc(penclen); 119 penc = malloc(penclen);
120 if (!penc) 120 if (!penc)
121 goto err; 121 goto err;
122 p = penc; 122 p = penc;
@@ -132,7 +132,7 @@ static int eckey_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey)
132 else 132 else
133 ASN1_STRING_free(pval); 133 ASN1_STRING_free(pval);
134 if (penc) 134 if (penc)
135 OPENSSL_free(penc); 135 free(penc);
136 return 0; 136 return 0;
137 } 137 }
138 138
@@ -339,7 +339,7 @@ static int eckey_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
339 ECerr(EC_F_ECKEY_PRIV_ENCODE, ERR_R_EC_LIB); 339 ECerr(EC_F_ECKEY_PRIV_ENCODE, ERR_R_EC_LIB);
340 return 0; 340 return 0;
341 } 341 }
342 ep = (unsigned char *) OPENSSL_malloc(eplen); 342 ep = (unsigned char *) malloc(eplen);
343 if (!ep) 343 if (!ep)
344 { 344 {
345 EC_KEY_set_enc_flags(ec_key, old_flags); 345 EC_KEY_set_enc_flags(ec_key, old_flags);
@@ -350,7 +350,7 @@ static int eckey_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
350 if (!i2d_ECPrivateKey(ec_key, &p)) 350 if (!i2d_ECPrivateKey(ec_key, &p))
351 { 351 {
352 EC_KEY_set_enc_flags(ec_key, old_flags); 352 EC_KEY_set_enc_flags(ec_key, old_flags);
353 OPENSSL_free(ep); 353 free(ep);
354 ECerr(EC_F_ECKEY_PRIV_ENCODE, ERR_R_EC_LIB); 354 ECerr(EC_F_ECKEY_PRIV_ENCODE, ERR_R_EC_LIB);
355 } 355 }
356 /* restore old encoding flags */ 356 /* restore old encoding flags */
@@ -474,7 +474,7 @@ static int do_EC_KEY_print(BIO *bp, const EC_KEY *x, int off, int ktype)
474 if (ktype > 0) 474 if (ktype > 0)
475 { 475 {
476 buf_len += 10; 476 buf_len += 10;
477 if ((buffer = OPENSSL_malloc(buf_len)) == NULL) 477 if ((buffer = malloc(buf_len)) == NULL)
478 { 478 {
479 reason = ERR_R_MALLOC_FAILURE; 479 reason = ERR_R_MALLOC_FAILURE;
480 goto err; 480 goto err;
@@ -515,7 +515,7 @@ err:
515 if (ctx) 515 if (ctx)
516 BN_CTX_free(ctx); 516 BN_CTX_free(ctx);
517 if (buffer != NULL) 517 if (buffer != NULL)
518 OPENSSL_free(buffer); 518 free(buffer);
519 return(ret); 519 return(ret);
520 } 520 }
521 521