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/29 07:26:58 UTC

svn commit: r570641 - in /webservices/rampart/trunk/c/src: omxmlsec/openssl/x509.c util/rampart_encryption.c

Author: kaushalye
Date: Tue Aug 28 22:26:58 2007
New Revision: 570641

URL: http://svn.apache.org/viewvc?rev=570641&view=rev
Log:
Fixing memory leaks

Modified:
    webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c
    webservices/rampart/trunk/c/src/util/rampart_encryption.c

Modified: webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c?rev=570641&r1=570640&r2=570641&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c (original)
+++ webservices/rampart/trunk/c/src/omxmlsec/openssl/x509.c Tue Aug 28 22:26:58 2007
@@ -378,6 +378,7 @@
                 DSA_print(out,pkey->pkey.dsa,0);
             }
             EVP_PKEY_free(pkey);
+            pkey = NULL;
         }
     }else if(OPENSSL_X509_INFO_PUBKEY_ALGO == type){
         X509_CINF *ci = NULL;
@@ -387,10 +388,10 @@
     }
     n = BIO_get_mem_data(out, &data);
     result = axutil_strndup( env, data, n);
-    
+   
     BIO_free(out);
     out = NULL;
-
+    
     return result;
 }
 

Modified: webservices/rampart/trunk/c/src/util/rampart_encryption.c
URL: http://svn.apache.org/viewvc/webservices/rampart/trunk/c/src/util/rampart_encryption.c?rev=570641&r1=570640&r2=570641&view=diff
==============================================================================
--- webservices/rampart/trunk/c/src/util/rampart_encryption.c (original)
+++ webservices/rampart/trunk/c/src/util/rampart_encryption.c Tue Aug 28 22:26:58 2007
@@ -341,6 +341,25 @@
         return AXIS2_FAILURE;
     }
 
+    /*Free id_list*/
+    if(id_list)
+    {
+        int size = 0;
+        int j = 0;
+        size = axutil_array_list_size(id_list, env);
+        for (j = 0; j < size; j++)
+        {
+            axis2_char_t *id = NULL;
+
+            id = axutil_array_list_get(id_list, env, j);
+            AXIS2_FREE(env->allocator, id);
+            id = NULL;
+        }
+        axutil_array_list_free(id_list, env);
+        id_list = NULL;
+    }
+  
+
     oxs_asym_ctx_free(asym_ctx, env);
     asym_ctx = NULL;