You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by se...@apache.org on 2008/02/24 17:44:14 UTC
svn commit: r630636 - /webservices/axis2/trunk/c/util/src/string.c
Author: senaka
Date: Sun Feb 24 08:44:12 2008
New Revision: 630636
URL: http://svn.apache.org/viewvc?rev=630636&view=rev
Log:
Adding some additional checks, and eliminating accidental leaks in axutil_strrtrim.
Modified:
webservices/axis2/trunk/c/util/src/string.c
Modified: webservices/axis2/trunk/c/util/src/string.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/util/src/string.c?rev=630636&r1=630635&r2=630636&view=diff
==============================================================================
--- webservices/axis2/trunk/c/util/src/string.c (original)
+++ webservices/axis2/trunk/c/util/src/string.c Sun Feb 24 08:44:12 2008
@@ -672,8 +672,10 @@
axis2_char_t *_s = NULL;
axis2_char_t *ret = NULL;
- _s = axutil_strdup(env, _in);
-
+ if (_in)
+ {
+ _s = axutil_strdup(env, _in);
+ }
if (!_s)
{
return NULL;
@@ -691,6 +693,10 @@
break;
}
*__tail = 0;
+ }
+ if (!ret && _s)
+ {
+ AXIS2_FREE(env->allocator, _s);
}
return ret;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org