tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <>
Subject Re: svn commit: r593943 - /tomcat/connectors/trunk/jk/native/apache-2.0/mod_jk.c
Date Mon, 12 Nov 2007 08:04:19 GMT
Mladen Turk schrieb:
> wrote:
>> Author: rjung
>> Date: Sun Nov 11 11:22:23 2007
>> New Revision: 593943
>> URL:
>> Log:
>> Undo revision 593927.
>> This produced a mem leak for vhosts with private JkMounts.
>> No idea why.
> Because uw_map is now allocated *only* if uri_to_context is
> allocated. In other cases uw_map is pointer to the parent
> allocated uw_map. So if you free uw_map with uri_to_context equals
> NULL, you'll actually have a double free of the same pointer.

The point was not a double free (crash), but a memory leak. I freed
uri_to_context in post_config and uw_map in the cleanup. Before freeing
I actually tested both against NULL.

To find out, where th eleak comes from, I also simply didn't initialize
uw_map and still had the leak!

When I didn't initialize uri_to_context in the JkMount config handler,
the leak went away.

With only uri_to_context used and uw_map artificially commented out, I
could open/close the leak by moving the free of uri_to_context from the
cleanup (OK) to post_config (bad). That's what I don't understand.



P.S.: I hope the other changes are fine with you?

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message