tls-1.6-fixmemleak-bugid3041925.diff at [db64a530a0]

File tls/patches/all/tls-1.6-fixmemleak-bugid3041925.diff artifact 13a18a6baa part of check-in db64a530a0


diff -uNr tls1.6.orig/tls.c tls1.6-fixmemleak-bugid3041925/tls.c
--- tls1.6.orig/tls.c	2008-03-19 17:06:13.000000000 -0500
+++ tls1.6-fixmemleak-bugid3041925/tls.c	2010-10-08 13:03:39.000000000 -0500
@@ -1156,6 +1156,8 @@
 	peer	= SSL_get_certificate(statePtr->ssl);
     if (peer) {
 	objPtr = Tls_NewX509Obj(interp, peer);
+
+	if (objc == 2) X509_free(peer);
     } else {
 	objPtr = Tcl_NewListObj(0, NULL);
     }