security: plug memory leaks in transform

refs #3758

Change-Id: Id8e3aa33c76017c1662fbed9a1cafea5b39e9d6f
diff --git a/src/security/transform/base64-decode.cpp b/src/security/transform/base64-decode.cpp
index 7f3cf54..8b047bc 100644
--- a/src/security/transform/base64-decode.cpp
+++ b/src/security/transform/base64-decode.cpp
@@ -48,7 +48,7 @@
 
   ~Impl()
   {
-    BIO_free_all(m_source);
+    BIO_free_all(m_base64);
   }
 
 public:
diff --git a/src/security/transform/base64-encode.cpp b/src/security/transform/base64-encode.cpp
index 0a27bed..60bc25f 100644
--- a/src/security/transform/base64-encode.cpp
+++ b/src/security/transform/base64-encode.cpp
@@ -44,7 +44,7 @@
 
   ~Impl()
   {
-    BIO_free_all(m_sink);
+    BIO_free_all(m_base64);
   }
 
 public:
diff --git a/src/security/transform/block-cipher.cpp b/src/security/transform/block-cipher.cpp
index b53ec4f..327aba6 100644
--- a/src/security/transform/block-cipher.cpp
+++ b/src/security/transform/block-cipher.cpp
@@ -40,7 +40,7 @@
 
   ~Impl()
   {
-    BIO_free_all(m_sink);
+    BIO_free_all(m_cipher);
   }
 
 public:
diff --git a/src/security/transform/transform-base.hpp b/src/security/transform/transform-base.hpp
index 98faf6d..b7a4561 100644
--- a/src/security/transform/transform-base.hpp
+++ b/src/security/transform/transform-base.hpp
@@ -67,6 +67,9 @@
 class Downstream
 {
 public:
+  virtual
+  ~Downstream() = default;
+
   /**
    * @brief Accept input data and perform transformation.
    *
@@ -152,6 +155,10 @@
  */
 class Upstream
 {
+public:
+  virtual
+  ~Upstream() = default;
+
 protected:
   Upstream();
 
diff --git a/src/security/transform/verifier-filter.cpp b/src/security/transform/verifier-filter.cpp
index 263e532..5f0c716 100644
--- a/src/security/transform/verifier-filter.cpp
+++ b/src/security/transform/verifier-filter.cpp
@@ -41,7 +41,7 @@
 
   ~Impl()
   {
-    BIO_free_all(m_sink);
+    BIO_free_all(m_md);
   }
 
 public: