You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2001/10/05 23:52:08 UTC
cvs commit: jakarta-tomcat-connectors/jk/native/common jk_ajp12_worker.c
marcsaeg 01/10/05 14:52:08
Modified: jk/native/apache-1.3 mod_jk.c
jk/native/apache-2.0 mod_jk.c
jk/native/common jk_ajp12_worker.c
Log:
Porting change from tomcat_32.
Fixes Bugzilla 2333. Instead of the proposed patch, which did its own
memory allocation, I used jk_pool_strdup(), but the end result is the same.
In the process of fixing this one I noticed that the jk_pool created in
mod_jk was not being closed. This usually doesn't leak because the pool's
buffer is allocated on the stack in jk_handler(), but it would leak any
dynamically allocated memory.
Revision Changes Path
1.19 +3 -1 jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c
Index: mod_jk.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-1.3/mod_jk.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- mod_jk.c 2001/10/01 21:30:49 1.18
+++ mod_jk.c 2001/10/05 21:52:08 1.19
@@ -61,7 +61,7 @@
* Author: Gal Shachor <sh...@il.ibm.com> *
* Dan Milstein <da...@shore.net> *
* Henri Gomez <hg...@slib.fr> *
- * Version: $Revision: 1.18 $ *
+ * Version: $Revision: 1.19 $ *
***************************************************************************/
/*
@@ -1132,6 +1132,8 @@
end->done(&end, l);
}
}
+
+ jk_close_pool(&private_data.p);
if(rc) {
return OK; /* NOT r->status, even if it has changed. */
1.29 +3 -1 jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c
Index: mod_jk.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/apache-2.0/mod_jk.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- mod_jk.c 2001/10/04 13:09:42 1.28
+++ mod_jk.c 2001/10/05 21:52:08 1.29
@@ -60,7 +60,7 @@
* Description: Apache 2 plugin for Jakarta/Tomcat *
* Author: Gal Shachor <sh...@il.ibm.com> *
* Henri Gomez <hg...@slib.fr> *
- * Version: $Revision: 1.28 $ *
+ * Version: $Revision: 1.29 $ *
***************************************************************************/
/*
@@ -1235,6 +1235,8 @@
#endif
}
}
+
+ jk_close_pool(&private_data.p);
if(rc) {
return OK; /* NOT r->status, even if it has changed. */
1.4 +2 -2 jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c
Index: jk_ajp12_worker.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/jk/native/common/jk_ajp12_worker.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- jk_ajp12_worker.c 2001/06/18 14:15:11 1.3
+++ jk_ajp12_worker.c 2001/10/05 21:52:08 1.4
@@ -59,7 +59,7 @@
* Description: ajpv1.2 worker, used to call local or remote jserv hosts *
* Author: Gal Shachor <sh...@il.ibm.com> *
* Based on: jserv_ajpv12.c from Jserv *
- * Version: $Revision: 1.3 $ *
+ * Version: $Revision: 1.4 $ *
***************************************************************************/
#include "jk_ajp12_worker.h"
@@ -545,7 +545,7 @@
jk_log(l, JK_LOG_ERROR, "ajpv12_handle_response, invalid status code\n");
return JK_FALSE;
}
- reason = strtok(NULL, " \t");
+ reason = jk_pool_strdup(s->pool, strtok(NULL, " \t"));
} else {
if(headers_capacity == headers_len) {
jk_log(l, JK_LOG_DEBUG, "ajpv12_handle_response, allocating header arrays\n");