ovs-openflowd: Don't segfault when no controllers specified
[sliver-openvswitch.git] / lib / stream-ssl.c
index 69beab9..9c7533d 100644 (file)
@@ -385,7 +385,7 @@ do_ca_cert_bootstrap(struct stream *stream)
 
     file = fdopen(fd, "w");
     if (!file) {
-        int error = errno;
+        error = errno;
         VLOG_ERR("could not bootstrap CA cert: fdopen failed: %s",
                  strerror(error));
         unlink(ca_cert.file_name);
@@ -402,7 +402,7 @@ do_ca_cert_bootstrap(struct stream *stream)
     }
 
     if (fclose(file)) {
-        int error = errno;
+        error = errno;
         VLOG_ERR("could not bootstrap CA cert: writing %s failed: %s",
                  ca_cert.file_name, strerror(error));
         unlink(ca_cert.file_name);
@@ -921,7 +921,7 @@ pssl_accept(struct pstream *pstream, struct stream **new_streamp)
 
     new_fd = accept(pssl->fd, &sin, &sin_len);
     if (new_fd < 0) {
-        int error = errno;
+        error = errno;
         if (error != EAGAIN) {
             VLOG_DBG_RL(&rl, "accept: %s", strerror(error));
         }
@@ -1045,7 +1045,7 @@ tmp_dh_callback(SSL *ssl OVS_UNUSED, int is_export OVS_UNUSED, int keylength)
 
 /* Returns true if SSL is at least partially configured. */
 bool
-stream_ssl_is_configured(void) 
+stream_ssl_is_configured(void)
 {
     return private_key.file_name || certificate.file_name || ca_cert.file_name;
 }
@@ -1262,7 +1262,7 @@ log_ca_cert(const char *file_name, X509 *cert)
     subject = X509_NAME_oneline(X509_get_subject_name(cert), NULL, 0);
     VLOG_INFO("Trusting CA cert from %s (%s) (fingerprint %s)", file_name,
               subject ? subject : "<out of memory>", ds_cstr(&fp));
-    free(subject);
+    OPENSSL_free(subject);
     ds_destroy(&fp);
 }