You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by se...@apache.org on 2008/03/03 15:25:37 UTC
svn commit: r633093 - /webservices/axis2/trunk/c/util/src/properties.c
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: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org