[PATCH] Fix memory leak like situation when parsing a svn_config_t object repeatedly
From: Bernd Rinn <bernd_at_sdf.lonestar.org>
Date: 2005-07-24 01:24:57 CEST
When using the functions svn_config_enumerate() and
The problem turned out to be in the system calls of apr_hash_first(). When I go
APR_DECLARE(apr_hash_index_t *) apr_hash_first(apr_pool_t *p, apr_hash_t *ht)
hi->ht = ht;
Here you can see that memory is allocated only if p != NULL, otherwise the
Thus I suggest to replace the function call in svn_config_enumerate_sections()
apr_hash_first (cfg->x_pool, cfg->sections)
by
apr_hash_first(NULL, cfg->sections)
Same with svn_config_enumerate(). I have verified that this change fixes my
The patch is trivial and applies cleanly to both, trunk and branches/1.2.x. So
Here is the log message:
[[[
Patch by: Bernd Rinn <bernd@sdf.lonestar.org>
* subversion/libsvn_subr/config.c
Regards,
---------------------------------------------------------------------
|
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.