Fix memory leak in ssl connection

The ssl stream is only freed if axis2_http_sender is used to initiate
the connection.  Direct use of axis2_http_client causes a memory leak
since the SSL stream is never properly freed.

This commit frees the stream in http_client, and adds safeguards to
axis2_ssl_stream_free to prevent issues if called again (such as from
http_sender).
diff --git a/src/core/transport/http/sender/http_client.c b/src/core/transport/http/sender/http_client.c
index 245e577..c65a293 100644
--- a/src/core/transport/http/sender/http_client.c
+++ b/src/core/transport/http/sender/http_client.c
@@ -123,19 +123,9 @@
     }
     if(-1 != http_client->sockfd)
     {
-#ifdef AXIS2_SSL_ENABLED
-		if(http_client->data_stream->stream_type == AXIS2_STREAM_SOCKET)
-		{
-            axutil_stream_free(http_client->data_stream, env);
-            http_client->data_stream = NULL;
-			axutil_network_handler_close_socket(env, http_client->sockfd);
-			/** ssl streams of type AXIS2_STREAM_BASIC  will be handled by SSL_shutdown(); */
-		}
-#else
         axutil_stream_free(http_client->data_stream, env);
         http_client->data_stream = NULL;
 		axutil_network_handler_close_socket(env, http_client->sockfd);
-#endif
         http_client->sockfd = -1;
     }
 
diff --git a/src/core/transport/http/sender/ssl/ssl_stream.c b/src/core/transport/http/sender/ssl/ssl_stream.c
index eb9ee45..50272c5 100644
--- a/src/core/transport/http/sender/ssl/ssl_stream.c
+++ b/src/core/transport/http/sender/ssl/ssl_stream.c
@@ -119,9 +119,15 @@
 {
     ssl_stream_impl_t *stream_impl = NULL;
     axutil_stream_t* stream = (axutil_stream_t*)streamv;
-    stream_impl = AXIS2_INTF_TO_IMPL(stream);
-    axis2_ssl_utils_cleanup_ssl(env, stream_impl->ctx, stream_impl->ssl);
-    AXIS2_FREE(env->allocator, stream_impl);
+    if (stream)
+    {
+        stream_impl = AXIS2_INTF_TO_IMPL(stream);
+        if (stream_impl)
+        {
+            axis2_ssl_utils_cleanup_ssl(env, stream_impl->ctx, stream_impl->ssl);
+            AXIS2_FREE(env->allocator, stream_impl);
+        }
+    }
 
     return;
 }