Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16806)
static int write_session(const char *filename, SSL_SESSION *sess)
{
- BIO *f = BIO_new_file(filename, "w");
+ BIO *f;
if (sess == NULL) {
BIO_printf(bio_err, "No session information\n");
return 0;
}
+
+ f = BIO_new_file(filename, "w");
if (f == NULL) {
BIO_printf(bio_err, "Can't open session file %s\n", filename);
ERR_print_errors(bio_err);