You are viewing a plain text version of this content. The canonical link for it is here.
Posted to rampart-dev@ws.apache.org by ka...@apache.org on 2007/08/27 12:50:27 UTC

svn commit: r570066 - in /webservices/rampart/trunk/c/src: omxmlsec/x509_cert.c util/rampart_context.c util/rampart_signature.c

Author: kaushalye
Date: Mon Aug 27 03:50:26 2007
New Revision: 570066

URL: http://svn.apache.org/viewvc?rev=570066&view=rev
Log:
Memory leak fix

Modified:
    webservices/rampart/trunk/c/src/omxmlsec/x509_cert.c
    webservices/rampart/trunk/c/src/util/rampart_context.c
    webservices/rampart/trunk/c/src/util/rampart_signature.c

Modified: webservices/rampart/trunk/c/src/omxmlsec/x509_cert.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/x509_cert.c?rev=570066&r1=570065&r2=570066&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/x509_cert.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/x509_cert.c Mon Aug 27 03:50:26 2007
@@ -97,14 +97,14 @@
         AXIS2_FREE(env->allocator, x509_cert->data );
         x509_cert->data =NULL;
     }
-    /*Free public key???*/
+    
     if(x509_cert->public_key){
         openssl_pkey_free(x509_cert->public_key, env);
         x509_cert->public_key = NULL;
     }
     
-    /*AXIS2_FREE(env->allocator,  x509_cert);
-    x509_cert = NULL;*/
+    AXIS2_FREE(env->allocator,  x509_cert);
+    x509_cert = NULL;
     
     return AXIS2_SUCCESS;
 }

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=570066&r1=570065&r2=570066&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_context.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_context.c Mon Aug 27 03:50:26 2007
@@ -239,6 +239,15 @@
             oxs_key_free(rampart_context->session_key, env);
             rampart_context->session_key = NULL;
         }
+
+        if(rampart_context->certificate){
+            oxs_x509_cert_free(rampart_context->certificate, env);
+            rampart_context->certificate = NULL;
+        }
+        if(rampart_context->receiver_certificate){
+            oxs_x509_cert_free(rampart_context->receiver_certificate, env);
+            rampart_context->receiver_certificate = NULL;
+        }
         AXIS2_FREE(env->allocator,rampart_context);
         rampart_context = NULL;
     }

Modified: webservices/rampart/trunk/c/src/util/rampart_signature.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_signature.c?rev=570066&r1=570065&r2=570066&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_signature.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_signature.c Mon Aug 27 03:50:26 2007
@@ -440,8 +440,6 @@
             AXIS2_LOG_INFO(env->log, "[rampart][rampart_signature] Unknown key Identifier type.Token attaching failed");
             status = AXIS2_FAILURE;
         }
-        oxs_x509_cert_free(cert, env);
-        cert = NULL;
     }
 
     /*FREE*/