-/* $OpenBSD: asn1pars.c,v 1.7 2017/01/20 08:57:11 deraadt Exp $ */
+/* $OpenBSD: asn1pars.c,v 1.8 2018/02/07 04:57:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
if (ret != 0)
ERR_print_errors(bio_err);
BUF_MEM_free(buf);
- if (at != NULL)
- ASN1_TYPE_free(at);
+ ASN1_TYPE_free(at);
sk_OPENSSL_STRING_free(asn1pars_config.osk);
OBJ_cleanup();
-/* $OpenBSD: dh.c,v 1.9 2017/01/20 08:57:11 deraadt Exp $ */
+/* $OpenBSD: dh.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
end:
BIO_free(in);
- if (out != NULL)
- BIO_free_all(out);
- if (dh != NULL)
- DH_free(dh);
+ BIO_free_all(out);
+ DH_free(dh);
return (ret);
}
-/* $OpenBSD: dhparam.c,v 1.9 2017/01/20 08:57:11 deraadt Exp $ */
+/* $OpenBSD: dhparam.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
BIO_printf(bio_err, "Generating DSA parameters, %d bit long prime\n", num);
if (!dsa || !DSA_generate_parameters_ex(dsa, num,
NULL, 0, NULL, NULL, &cb)) {
- if (dsa)
- DSA_free(dsa);
+ DSA_free(dsa);
ERR_print_errors(bio_err);
goto end;
}
end:
BIO_free(in);
- if (out != NULL)
- BIO_free_all(out);
- if (dh != NULL)
- DH_free(dh);
+ BIO_free_all(out);
+ DH_free(dh);
return (ret);
}
-/* $OpenBSD: dsa.c,v 1.9 2017/01/20 08:57:11 deraadt Exp $ */
+/* $OpenBSD: dsa.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
ret = 0;
end:
BIO_free(in);
- if (out != NULL)
- BIO_free_all(out);
- if (dsa != NULL)
- DSA_free(dsa);
+ BIO_free_all(out);
+ DSA_free(dsa);
free(passin);
free(passout);
-/* $OpenBSD: dsaparam.c,v 1.8 2017/01/20 08:57:12 deraadt Exp $ */
+/* $OpenBSD: dsaparam.c,v 1.9 2018/02/07 04:57:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
end:
BIO_free(in);
- if (out != NULL)
- BIO_free_all(out);
- if (dsa != NULL)
- DSA_free(dsa);
+ BIO_free_all(out);
+ DSA_free(dsa);
return (ret);
}
-/* $OpenBSD: ec.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */
+/* $OpenBSD: ec.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */
/*
* Written by Nils Larsch for the OpenSSL project.
*/
ret = 0;
end:
BIO_free(in);
- if (out)
- BIO_free_all(out);
- if (eckey)
- EC_KEY_free(eckey);
+ BIO_free_all(out);
+ EC_KEY_free(eckey);
free(passin);
free(passout);
-/* $OpenBSD: enc.c,v 1.12 2017/01/20 08:57:12 deraadt Exp $ */
+/* $OpenBSD: enc.c,v 1.13 2018/02/07 04:57:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
free(strbuf);
free(buff);
BIO_free(in);
- if (out != NULL)
- BIO_free_all(out);
+ BIO_free_all(out);
BIO_free(benc);
BIO_free(b64);
#ifdef ZLIB
-/* $OpenBSD: gendh.c,v 1.8 2017/01/20 08:57:12 deraadt Exp $ */
+/* $OpenBSD: gendh.c,v 1.9 2018/02/07 04:57:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
end:
if (ret != 0)
ERR_print_errors(bio_err);
- if (out != NULL)
- BIO_free_all(out);
- if (dh != NULL)
- DH_free(dh);
+ BIO_free_all(out);
+ DH_free(dh);
return (ret);
}
-/* $OpenBSD: gendsa.c,v 1.8 2017/01/20 08:57:12 deraadt Exp $ */
+/* $OpenBSD: gendsa.c,v 1.9 2018/02/07 04:57:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
if (ret != 0)
ERR_print_errors(bio_err);
BIO_free(in);
- if (out != NULL)
- BIO_free_all(out);
- if (dsa != NULL)
- DSA_free(dsa);
+ BIO_free_all(out);
+ DSA_free(dsa);
free(passout);
return (ret);
-/* $OpenBSD: genpkey.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */
+/* $OpenBSD: genpkey.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006
*/
ret = 0;
end:
- if (pkey)
- EVP_PKEY_free(pkey);
- if (ctx)
- EVP_PKEY_CTX_free(ctx);
- if (out)
- BIO_free_all(out);
+ EVP_PKEY_free(pkey);
+ EVP_PKEY_CTX_free(ctx);
+ BIO_free_all(out);
BIO_free(in);
free(pass);
err:
BIO_puts(err, "Error initializing context\n");
ERR_print_errors(err);
- if (ctx)
- EVP_PKEY_CTX_free(ctx);
- if (pkey)
- EVP_PKEY_free(pkey);
+ EVP_PKEY_CTX_free(ctx);
+ EVP_PKEY_free(pkey);
return 0;
}
err:
BIO_printf(err, "Error initializing %s context\n", algname);
ERR_print_errors(err);
- if (ctx)
- EVP_PKEY_CTX_free(ctx);
+ EVP_PKEY_CTX_free(ctx);
return 0;
}
-/* $OpenBSD: genrsa.c,v 1.9 2017/01/20 08:57:12 deraadt Exp $ */
+/* $OpenBSD: genrsa.c,v 1.10 2018/02/07 04:57:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
ret = 0;
err:
- if (bn)
- BN_free(bn);
- if (rsa)
- RSA_free(rsa);
- if (out)
- BIO_free_all(out);
+ BN_free(bn);
+ RSA_free(rsa);
+ BIO_free_all(out);
free(passout);
+
if (ret != 0)
ERR_print_errors(bio_err);
-/* $OpenBSD: pkeyutl.c,v 1.12 2018/01/28 09:21:34 inoguchi Exp $ */
+/* $OpenBSD: pkeyutl.c,v 1.13 2018/02/07 04:57:06 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
BIO_write(out, buf_out, buf_outlen);
end:
- if (ctx)
- EVP_PKEY_CTX_free(ctx);
+ EVP_PKEY_CTX_free(ctx);
BIO_free(in);
BIO_free_all(out);
free(buf_in);
-/* $OpenBSD: rand.c,v 1.11 2017/01/20 08:57:12 deraadt Exp $ */
+/* $OpenBSD: rand.c,v 1.12 2018/02/07 04:57:06 jsing Exp $ */
/* ====================================================================
* Copyright (c) 1998-2001 The OpenSSL Project. All rights reserved.
*
err:
ERR_print_errors(bio_err);
- if (out)
- BIO_free_all(out);
+ BIO_free_all(out);
return (ret);
}
-/* $OpenBSD: s_client.c,v 1.33 2017/08/12 21:04:33 jsing Exp $ */
+/* $OpenBSD: s_client.c,v 1.34 2018/02/07 04:57:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
print_stuff(bio_c_out, con, 1);
SSL_free(con);
}
- if (ctx != NULL)
- SSL_CTX_free(ctx);
- if (cert)
- X509_free(cert);
- if (key)
- EVP_PKEY_free(key);
+ SSL_CTX_free(ctx);
+ X509_free(cert);
+ EVP_PKEY_free(key);
free(pass);
- if (vpm)
- X509_VERIFY_PARAM_free(vpm);
+ X509_VERIFY_PARAM_free(vpm);
freezero(cbuf, BUFSIZZ);
freezero(sbuf, BUFSIZZ);
freezero(mbuf, BUFSIZZ);
}
}
BIO_printf(bio, "---\n");
- if (peer != NULL)
- X509_free(peer);
+ X509_free(peer);
/* flush, or debugging output gets mixed with http response */
(void) BIO_flush(bio);
}
-/* $OpenBSD: s_server.c,v 1.28 2018/01/28 09:21:34 inoguchi Exp $ */
+/* $OpenBSD: s_server.c,v 1.29 2018/02/07 04:57:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
print_stats(bio_s_out, ctx);
ret = 0;
end:
- if (ctx != NULL)
- SSL_CTX_free(ctx);
- if (s_cert)
- X509_free(s_cert);
- if (s_dcert)
- X509_free(s_dcert);
- if (s_key)
- EVP_PKEY_free(s_key);
- if (s_dkey)
- EVP_PKEY_free(s_dkey);
+ SSL_CTX_free(ctx);
+ X509_free(s_cert);
+ X509_free(s_dcert);
+ EVP_PKEY_free(s_key);
+ EVP_PKEY_free(s_dkey);
free(pass);
free(dpass);
- if (vpm)
- X509_VERIFY_PARAM_free(vpm);
+ X509_VERIFY_PARAM_free(vpm);
free(tlscstatp.host);
free(tlscstatp.port);
free(tlscstatp.path);
- if (ctx2 != NULL)
- SSL_CTX_free(ctx2);
- if (s_cert2)
- X509_free(s_cert2);
- if (s_key2)
- EVP_PKEY_free(s_key2);
+ SSL_CTX_free(ctx2);
+ X509_free(s_cert2);
+ EVP_PKEY_free(s_key2);
free(alpn_ctx.data);
if (bio_s_out != NULL) {
BIO_free(bio_s_out);
BIO_printf(bio_s_out, "ACCEPT\n");
free(buf);
- if (io != NULL)
- BIO_free_all(io);
+ BIO_free_all(io);
/* if (ssl_bio != NULL) BIO_free(ssl_bio);*/
return (ret);
}
-/* $OpenBSD: s_time.c,v 1.21 2018/02/06 02:40:29 tb Exp $ */
+/* $OpenBSD: s_time.c,v 1.22 2018/02/07 04:57:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
ret = 0;
end:
- if (scon != NULL)
- SSL_free(scon);
+ SSL_free(scon);
if (tm_ctx != NULL) {
SSL_CTX_free(tm_ctx);
-/* $OpenBSD: smime.c,v 1.8 2017/01/20 08:57:12 deraadt Exp $ */
+/* $OpenBSD: smime.c,v 1.9 2018/02/07 04:57:06 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project.
*/
ERR_print_errors(bio_err);
sk_X509_pop_free(encerts, X509_free);
sk_X509_pop_free(other, X509_free);
- if (vpm)
- X509_VERIFY_PARAM_free(vpm);
- if (sksigners)
- sk_OPENSSL_STRING_free(sksigners);
- if (skkeys)
- sk_OPENSSL_STRING_free(skkeys);
+ X509_VERIFY_PARAM_free(vpm);
+ sk_OPENSSL_STRING_free(sksigners);
+ sk_OPENSSL_STRING_free(skkeys);
X509_STORE_free(store);
X509_free(cert);
X509_free(recip);
-/* $OpenBSD: x509.c,v 1.14 2017/01/20 08:57:12 deraadt Exp $ */
+/* $OpenBSD: x509.c,v 1.15 2018/02/07 04:57:06 jsing Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
X509_free(xca);
EVP_PKEY_free(Upkey);
EVP_PKEY_free(CApkey);
- if (sigopts)
- sk_OPENSSL_STRING_free(sigopts);
+ sk_OPENSSL_STRING_free(sigopts);
X509_REQ_free(rq);
ASN1_INTEGER_free(sno);
sk_ASN1_OBJECT_pop_free(trust, ASN1_OBJECT_free);