svn commit: r1850984 - in /tomcat/native/trunk: native/src/sslcontext.c xdocs/miscellaneous/changelog.xml

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1850984 - in /tomcat/native/trunk: native/src/sslcontext.c xdocs/miscellaneous/changelog.xml

markt
Author: markt
Date: Thu Jan 10 22:07:56 2019
New Revision: 1850984

URL: http://svn.apache.org/viewvc?rev=1850984&view=rev
Log:
Fix a minor memory leak. It occurred every time a TLS connector was started so the impact was very unlikely to be noticed.

Modified:
    tomcat/native/trunk/native/src/sslcontext.c
    tomcat/native/trunk/xdocs/miscellaneous/changelog.xml

Modified: tomcat/native/trunk/native/src/sslcontext.c
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/native/src/sslcontext.c?rev=1850984&r1=1850983&r2=1850984&view=diff
==============================================================================
--- tomcat/native/trunk/native/src/sslcontext.c (original)
+++ tomcat/native/trunk/native/src/sslcontext.c Thu Jan 10 22:07:56 2019
@@ -374,10 +374,12 @@ TCN_IMPLEMENT_CALL(jlong, SSLContext, ma
                               apr_pool_cleanup_null);
 
     /* Cache the byte[].class for performance reasons */
-    clazz = (*e)->FindClass(e, "[B");
-    byteArrayClass = (jclass) (*e)->NewGlobalRef(e, clazz);
-    sClazz = (*e)->FindClass(e, "java/lang/String");
-    stringClass = (jclass) (*e)->NewGlobalRef(e, sClazz);
+    if (stringClass == NULL) {
+        clazz = (*e)->FindClass(e, "[B");
+        byteArrayClass = (jclass) (*e)->NewGlobalRef(e, clazz);
+        sClazz = (*e)->FindClass(e, "java/lang/String");
+        stringClass = (jclass) (*e)->NewGlobalRef(e, sClazz);
+    }
 
     return P2J(c);
 init_failed:

Modified: tomcat/native/trunk/xdocs/miscellaneous/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/native/trunk/xdocs/miscellaneous/changelog.xml?rev=1850984&r1=1850983&r2=1850984&view=diff
==============================================================================
--- tomcat/native/trunk/xdocs/miscellaneous/changelog.xml (original)
+++ tomcat/native/trunk/xdocs/miscellaneous/changelog.xml Thu Jan 10 22:07:56 2019
@@ -39,6 +39,10 @@
     <fix>
       Update includedir name to tomcat-native instead of apr. (csutherl)
     </fix>
+    <fix>
+      Fix a minor memory leak. It ocurred every time a TLS connector was started
+      so the impact was very unlikely to be noticed. (markt)
+    </fix>
   </changelog>
 </section>
 <section name="Changes in 1.2.19">



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]