Author: billblough
Date: Tue Dec 4 05:15:39 2018
New Revision: 1848125
URL: http://svn.apache.org/viewvc?rev=1848125&view=rev
Log:
Fix memleak in clientapi options
Patch obtained from AXIS2C-1669.
Modified:
axis/axis2/c/core/trunk/src/core/clientapi/options.c
Modified: axis/axis2/c/core/trunk/src/core/clientapi/options.c
URL:
http://svn.apache.org/viewvc/axis/axis2/c/core/trunk/src/core/clientapi/options.c?rev=1848125&r1=1848124&r2=1848125&view=diff
==============================================================================
--- axis/axis2/c/core/trunk/src/core/clientapi/options.c (original)
+++ axis/axis2/c/core/trunk/src/core/clientapi/options.c Tue Dec 4 05:15:39
2018
@@ -515,7 +515,13 @@ axis2_options_set_property(
const axis2_char_t * property_key,
const void *property)
{
+ /* free old property */
+ axutil_property_t *old_property =
+ (axutil_property_t *)axutil_hash_get(
+ options->properties, property_key,
AXIS2_HASH_KEY_STRING);
axutil_hash_set(options->properties, property_key, AXIS2_HASH_KEY_STRING,
property);
+ if (old_property)
+ axutil_property_free(old_property, env);
return AXIS2_SUCCESS;
}