c.s.r.c.murthy via RT wrote:
Dear Sir,
        Memory leak is found in EVP sign & verify functions

Its just an example, this is not a leak in the library only the example.

Darryl

--- /tmp/openssl-0.9.8b/demos/sign/sign.c	2001-09-28 01:47:36.000000000 +0100
+++ sign.c	2006-07-01 00:27:41.000000000 +0100
@@ -103,6 +103,8 @@
 	ERR_print_errors_fp (stderr);
 	exit (1);
   }
+
+  EVP_MD_CTX_init(&md_ctx);
   
   /* Do the signature */
   
@@ -117,6 +119,7 @@
   }
 
   EVP_PKEY_free (pkey);
+  EVP_MD_CTX_cleanup(&md_ctx);
   
   /* Read public key */
   
@@ -149,5 +152,9 @@
 	exit (1);
   }
   printf ("Signature Verified Ok.\n");
+
+  X509_free(x509);
+  EVP_MD_CTX_cleanup(&md_ctx);
+ 
   return(0);
 }

Reply via email to