Miscellaneous style tweaks based on feedback received
[oweals/openssl.git] / apps / s_client.c
index 362f005cc5eb6e0132284e368b90d04a7d2c658e..99770b9b978a3e62548d952416a4304baaa90880 100644 (file)
@@ -784,11 +784,11 @@ static int new_session_cb(SSL *S, SSL_SESSION *sess)
 {
     BIO *stmp = BIO_new_file(sess_out, "w");
 
-    if (stmp != NULL) {
+    if (stmp == NULL) {
+        BIO_printf(bio_err, "Error writing session file %s\n", sess_out);
+    } else {
         PEM_write_bio_SSL_SESSION(stmp, sess);
         BIO_free(stmp);
-    } else {
-        BIO_printf(bio_err, "Error writing session file %s\n", sess_out);
     }
 
     /*