Author: shankar
Date: Fri Oct 30 08:57:24 2009
New Revision: 831231
URL: http://svn.apache.org/viewvc?rev=831231&view=rev
Log:
Fixing memory leak
Modified:
webservices/rampart/trunk/c/src/util/rampart_context.c
webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c
Modified: webservices/rampart/trunk/c/src/util/rampart_context.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_context.c?rev=831231&r1=831230&r2=831231&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_context.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_context.c Fri Oct 30 08:57:24
2009
@@ -357,11 +357,11 @@
}
/* Free receiver certificate we found when processing incoming
security header */
- /*if(rampart_context->receiver_cert &&
rampart_context->found_cert_in_shp)
+ if(rampart_context->receiver_cert &&
rampart_context->found_cert_in_shp)
{
oxs_x509_cert_free(rampart_context->receiver_cert, env);
rampart_context->receiver_cert = NULL;
- }*/
+ }
if(rampart_context->key_mgr)
{
Modified: webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c
URL:
http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c?rev=831231&r1=831230&r2=831231&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c
(original)
+++ webservices/rampart/trunk/c/src/util/rampart_sec_header_processor.c Fri Oct
30 08:57:24 2009
@@ -1614,7 +1614,11 @@
/* if security context token or X509 token is used, then store it. It will
be used by the
* server to sign the message */
rampart_shp_store_token_id(env, key_info_node, rampart_context, sec_node,
AXIS2_FALSE, msg_ctx);
- if(public_cert)
+
+ /* receiver certificate should be stored only if token is included as
reference or embedded */
+ if((public_cert) &&
+ ((0 == axutil_strcmp(reference_method, OXS_NODE_REFERENCE))
+ || (0 == axutil_strcmp(reference_method, OXS_NODE_EMBEDDED))))
{
rampart_context_set_found_cert_in_shp(rampart_context, env,
AXIS2_TRUE);
rampart_context_set_receiver_cert_found_in_shp(rampart_context, env,
public_cert);