marcsaeg 01/10/05 14:50:14
Modified: src/native/apache1.3 Tag: tomcat_32 mod_jk.c
src/native/apache2.0 Tag: tomcat_32 mod_jk.c
src/native/jk Tag: tomcat_32 jk_ajp12_worker.c
Log:
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.
I'll commit the same changes to the jakarta-tomcat-connectors repository.
PR: 2333
Submitted by: [EMAIL PROTECTED]
Revision Changes Path
No revision
No revision
1.7.2.7 +2 -0 jakarta-tomcat/src/native/apache1.3/Attic/mod_jk.c
Index: mod_jk.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/native/apache1.3/Attic/mod_jk.c,v
retrieving revision 1.7.2.6
retrieving revision 1.7.2.7
diff -u -r1.7.2.6 -r1.7.2.7
--- mod_jk.c 2001/09/17 23:53:21 1.7.2.6
+++ mod_jk.c 2001/10/05 21:50:14 1.7.2.7
@@ -703,6 +703,8 @@
}
}
+ jk_close_pool(&private_data.p);
+
if(rc) {
return OK; /* NOT r->status, even if it has changed. */
}
No revision
No revision
1.6.2.2 +2 -0 jakarta-tomcat/src/native/apache2.0/Attic/mod_jk.c
Index: mod_jk.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/native/apache2.0/Attic/mod_jk.c,v
retrieving revision 1.6.2.1
retrieving revision 1.6.2.2
diff -u -r1.6.2.1 -r1.6.2.2
--- mod_jk.c 2001/05/19 04:23:43 1.6.2.1
+++ mod_jk.c 2001/10/05 21:50:14 1.6.2.2
@@ -523,6 +523,8 @@
}
}
+ jk_close_pool(&private_data.p);
+
if(rc) {
return OK; /* NOT r->status, even if it has changed. */
}
No revision
No revision
1.2.2.2 +3 -3 jakarta-tomcat/src/native/jk/Attic/jk_ajp12_worker.c
Index: jk_ajp12_worker.c
===================================================================
RCS file: /home/cvs/jakarta-tomcat/src/native/jk/Attic/jk_ajp12_worker.c,v
retrieving revision 1.2.2.1
retrieving revision 1.2.2.2
diff -u -r1.2.2.1 -r1.2.2.2
--- jk_ajp12_worker.c 2001/02/01 22:50:09 1.2.2.1
+++ jk_ajp12_worker.c 2001/10/05 21:50:14 1.2.2.2
@@ -57,7 +57,7 @@
* Description: ajpv1.2 worker, used to call local or remote jserv hosts *
* Author: Gal Shachor <[EMAIL PROTECTED]> *
* Based on: jserv_ajpv12.c from Jserv *
- * Version: $Revision: 1.2.2.1 $ *
+ * Version: $Revision: 1.2.2.2 $ *
***************************************************************************/
#include "jk_ajp12_worker.h"
@@ -534,14 +534,14 @@
jk_log(l, JK_LOG_DEBUG, "ajpv12_handle_response, read %s=%s\n", name,
value);
if(0 == strcmp("Status", name)) {
- char *numeric = strtok(value, " \t");
+ char *numeric = strtok(value, " \t");
status = atoi(numeric);
if(status < 100 || status > 999) {
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");