}
ret = PKCS12_parse(p12, pass, pkey, cert, ca);
die:
- if (p12)
- PKCS12_free(p12);
+ PKCS12_free(p12);
return ret;
}
end:
BIO_free(in);
BIO_free_all(out);
- if (p7 != NULL)
- PKCS7_free(p7);
+ PKCS7_free(p7);
if (crl != NULL)
X509_CRL_free(crl);
# endif
ret = 0;
end:
- if (p12)
- PKCS12_free(p12);
+ PKCS12_free(p12);
if (export_cert || inrand)
app_RAND_write_file(NULL, bio_err);
# ifdef CRYPTO_MDEBUG
ret = 1;
err:
-
- if (asafes)
- sk_PKCS7_pop_free(asafes, PKCS7_free);
+ sk_PKCS7_pop_free(asafes, PKCS7_free);
return ret;
}
}
ret = 0;
end:
- if (p7 != NULL)
- PKCS7_free(p7);
+ PKCS7_free(p7);
BIO_free(in);
BIO_free_all(out);
apps_shutdown();
EC_POINT_free(generator);
if (new_ctx != NULL)
BN_CTX_free(new_ctx);
- if (pre)
- nistp224_pre_comp_free(pre);
+ nistp224_pre_comp_free(pre);
return ret;
}
EC_POINT_free(generator);
if (new_ctx != NULL)
BN_CTX_free(new_ctx);
- if (pre)
- nistp256_pre_comp_free(pre);
+ nistp256_pre_comp_free(pre);
return ret;
}
EC_POINT_free(generator);
if (new_ctx != NULL)
BN_CTX_free(new_ctx);
- if (pre)
- nistp521_pre_comp_free(pre);
+ nistp521_pre_comp_free(pre);
return ret;
}
err:
if (ctx != NULL)
BN_CTX_end(ctx);
- if (pre_comp)
- ecp_nistz256_pre_comp_free(pre_comp);
+ ecp_nistz256_pre_comp_free(pre_comp);
if (precomp_storage)
OPENSSL_free(precomp_storage);
EC_POINT_free(P);
return p12;
err:
-
- if (p12)
- PKCS12_free(p12);
- if (safes)
- sk_PKCS7_pop_free(safes, PKCS7_free);
- if (bags)
- sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
+ PKCS12_free(p12);
+ sk_PKCS7_pop_free(safes, PKCS7_free);
+ sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free);
return NULL;
}
return bag;
err:
-
- if (bag)
- PKCS12_SAFEBAG_free(bag);
-
+ PKCS12_SAFEBAG_free(bag);
return NULL;
}
return bag;
err:
-
- if (bag)
- PKCS12_SAFEBAG_free(bag);
-
+ PKCS12_SAFEBAG_free(bag);
return NULL;
}
sk_PKCS7_free(*psafes);
*psafes = NULL;
}
-
- if (p7)
- PKCS7_free(p7);
-
+ PKCS7_free(p7);
return 0;
}
PKCS12err(PKCS12_F_PKCS12_INIT, PKCS12_R_UNSUPPORTED_PKCS12_MODE);
goto err;
}
-
return pkcs12;
+
err:
- if (pkcs12 != NULL)
- PKCS12_free(pkcs12);
+ PKCS12_free(pkcs12);
return NULL;
}
return (1);
err:
- if (ret != NULL)
- PKCS7_free(ret);
+ PKCS7_free(ret);
return (0);
}
i = OBJ_obj2nid(p7->type);
switch (i) {
case NID_pkcs7_signed:
- if (p7->d.sign->contents != NULL)
- PKCS7_free(p7->d.sign->contents);
+ PKCS7_free(p7->d.sign->contents);
p7->d.sign->contents = p7_data;
break;
case NID_pkcs7_digest:
- if (p7->d.digest->contents != NULL)
- PKCS7_free(p7->d.digest->contents);
+ PKCS7_free(p7->d.digest->contents);
p7->d.digest->contents = p7_data;
break;
case NID_pkcs7_data:
goto err;
return (si);
err:
- if (si)
- PKCS7_SIGNER_INFO_free(si);
+ PKCS7_SIGNER_INFO_free(si);
return (NULL);
}
goto err;
return ri;
err:
- if (ri)
- PKCS7_RECIP_INFO_free(ri);
+ PKCS7_RECIP_INFO_free(ri);
return NULL;
}
ret = 0;
err:
-
if (ret) {
fprintf(stderr, "Error Signing Data\n");
ERR_print_errors_fp(stderr);
}
-
- if (p7)
- PKCS7_free(p7);
+ PKCS7_free(p7);
if (rcert)
X509_free(rcert);
EVP_PKEY_free(rkey);
-
BIO_free(in);
BIO_free(out);
BIO_free(tbio);
ret = 0;
err:
-
if (ret) {
fprintf(stderr, "Error Encrypting Data\n");
ERR_print_errors_fp(stderr);
}
-
- if (p7)
- PKCS7_free(p7);
+ PKCS7_free(p7);
if (rcert)
X509_free(rcert);
if (recips)
sk_X509_pop_free(recips, X509_free);
-
BIO_free(in);
BIO_free(out);
BIO_free(tbio);
-
return ret;
}
ret = 0;
err:
-
if (ret) {
fprintf(stderr, "Error Signing Data\n");
ERR_print_errors_fp(stderr);
}
-
- if (p7)
- PKCS7_free(p7);
+ PKCS7_free(p7);
if (scert)
X509_free(scert);
EVP_PKEY_free(skey);
-
BIO_free(in);
BIO_free(out);
BIO_free(tbio);
ret = 0;
err:
-
if (ret) {
fprintf(stderr, "Error Signing Data\n");
ERR_print_errors_fp(stderr);
}
-
- if (p7)
- PKCS7_free(p7);
-
+ PKCS7_free(p7);
if (scert)
X509_free(scert);
EVP_PKEY_free(skey);
-
if (scert2)
X509_free(scert2);
EVP_PKEY_free(skey2);
-
BIO_free(in);
BIO_free(out);
BIO_free(tbio);
-
return ret;
-
}
ret = 0;
err:
-
if (ret) {
fprintf(stderr, "Error Verifying Data\n");
ERR_print_errors_fp(stderr);
}
-
- if (p7)
- PKCS7_free(p7);
-
+ PKCS7_free(p7);
if (cacert)
X509_free(cacert);
-
BIO_free(in);
BIO_free(out);
BIO_free(tbio);
-
return ret;
-
}
ssl_clear_hash_ctx(&s->read_hash);
ssl_clear_hash_ctx(&s->write_hash);
- if (s->cert != NULL)
- ssl_cert_free(s->cert);
+ ssl_cert_free(s->cert);
/* Free up if allocated */
#ifndef OPENSSL_NO_TLSEXT
if (s->tlsext_hostname)
OPENSSL_free(s->tlsext_hostname);
- if (s->initial_ctx)
- SSL_CTX_free(s->initial_ctx);
+ SSL_CTX_free(s->initial_ctx);
# ifndef OPENSSL_NO_EC
if (s->tlsext_ecpointformatlist)
OPENSSL_free(s->tlsext_ecpointformatlist);
RECORD_LAYER_release(&s->rlayer);
- if (s->ctx)
- SSL_CTX_free(s->ctx);
+ SSL_CTX_free(s->ctx);
#ifndef OPENSSL_NO_KRB5
if (s->kssl_ctx != NULL)
err:
SSLerr(SSL_F_SSL_CTX_NEW, ERR_R_MALLOC_FAILURE);
err2:
- if (ret != NULL)
- SSL_CTX_free(ret);
+ SSL_CTX_free(ret);
return (NULL);
}
sk_SSL_CIPHER_free(a->cipher_list);
if (a->cipher_list_by_id != NULL)
sk_SSL_CIPHER_free(a->cipher_list_by_id);
- if (a->cert != NULL)
- ssl_cert_free(a->cert);
+ ssl_cert_free(a->cert);
if (a->client_CA != NULL)
sk_X509_NAME_pop_free(a->client_CA, X509_NAME_free);
if (a->extra_certs != NULL)
ret->method->ssl_new(ret);
if (s->cert != NULL) {
- if (ret->cert != NULL) {
- ssl_cert_free(ret->cert);
- }
+ ssl_cert_free(ret->cert);
ret->cert = ssl_cert_dup(s->cert);
if (ret->cert == NULL)
goto err;
if (0) {
err:
- if (ret != NULL)
- SSL_free(ret);
+ SSL_free(ret);
ret = NULL;
}
return (ret);
}
CRYPTO_add(&ctx->references, 1, CRYPTO_LOCK_SSL_CTX);
- if (ssl->ctx != NULL)
- SSL_CTX_free(ssl->ctx); /* decrement reference count */
+ SSL_CTX_free(ssl->ctx); /* decrement reference count */
ssl->ctx = ctx;
return (ssl->ctx);
OPENSSL_cleanse(ss->master_key, sizeof ss->master_key);
OPENSSL_cleanse(ss->session_id, sizeof ss->session_id);
- if (ss->sess_cert != NULL)
- ssl_sess_cert_free(ss->sess_cert);
+ ssl_sess_cert_free(ss->sess_cert);
if (ss->peer != NULL)
X509_free(ss->peer);
if (ss->ciphers != NULL)
/* CRYPTO_w_lock(CRYPTO_LOCK_SSL); */
CRYPTO_add(&session->references, 1, CRYPTO_LOCK_SSL_SESSION);
- if (s->session != NULL)
- SSL_SESSION_free(s->session);
+ SSL_SESSION_free(s->session);
s->session = session;
s->verify_result = s->session->verify_result;
/* CRYPTO_w_unlock(CRYPTO_LOCK_SSL); */
ret = 1;
} else {
- if (s->session != NULL) {
- SSL_SESSION_free(s->session);
- s->session = NULL;
- }
-
+ SSL_SESSION_free(s->session);
+ s->session = NULL;
meth = s->ctx->method;
if (meth != s->method) {
if (!SSL_set_ssl_method(s, meth))
ret = 1;
done:
- if (p8inf != NULL) {
- PKCS8_PRIV_KEY_INFO_free(p8inf);
- }
-
+ PKCS8_PRIV_KEY_INFO_free(p8inf);
EVP_PKEY_free(pkey);
return ret;
end:
SSL_CTX_free(s_ctx);
SSL_CTX_free(c_ctx);
-
SSL_CONF_CTX_free(s_cctx);
SSL_CONF_CTX_free(c_cctx);
sk_OPENSSL_STRING_free(conf_args);