Author: senaka Date: Mon Mar 3 06:25:37 2008 New Revision: 633093 URL: http://svn.apache.org/viewvc?rev=633093&view=rev Log: Fixing memory leak in properties.c
Modified: webservices/axis2/trunk/c/util/src/properties.c Modified: webservices/axis2/trunk/c/util/src/properties.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/properties.c?rev=633093&r1=633092&r2=633093&view=diff ============================================================================== --- webservices/axis2/trunk/c/util/src/properties.c (original) +++ webservices/axis2/trunk/c/util/src/properties.c Mon Mar 3 06:25:37 2008 @@ -116,9 +116,18 @@ axis2_char_t * key, axis2_char_t * value) { + axis2_char_t *old = NULL; AXIS2_ENV_CHECK(env, AXIS2_FAILURE); AXIS2_PARAM_CHECK(env->error, key, AXIS2_FAILURE); + old = axutil_properties_get_property(properties, env, key); + if (old) + { + AXIS2_FREE(env->allocator, old); + axutil_hash_set(properties->prop_hash, key, + AXIS2_HASH_KEY_STRING, axutil_strdup(env, value)); + return AXIS2_SUCCESS; + } axutil_hash_set(properties->prop_hash, axutil_strdup(env, key), AXIS2_HASH_KEY_STRING, axutil_strdup(env, value)); return AXIS2_SUCCESS; --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]