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 di...@apache.org on 2007/01/24 07:42:54 UTC

svn commit: r499280 - /webservices/axis2/trunk/c/guththila/src/guththila_attribute.c

Author: dinesh
Date: Tue Jan 23 22:42:54 2007
New Revision: 499280

URL: http://svn.apache.org/viewvc?view=rev&rev=499280
Log:
guththila_attribute.c added, more effective way to deal with memory leak in attributes

Added:
    webservices/axis2/trunk/c/guththila/src/guththila_attribute.c

Added: webservices/axis2/trunk/c/guththila/src/guththila_attribute.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_attribute.c?view=auto&rev=499280
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_attribute.c (added)
+++ webservices/axis2/trunk/c/guththila/src/guththila_attribute.c Tue Jan 23 22:42:54 2007
@@ -0,0 +1,42 @@
+#include <guththila_token.h>
+#include <guththila_attribute.h>
+
+AXIS2_EXTERN guththila_attribute_t *AXIS2_CALL
+guththila_attribute_create (
+	axis2_env_t *env, 
+	guththila_token_t *prefix, 
+	guththila_token_t *name, 
+	guththila_token_t *value,
+	guththila_token_t *namespace_uri)
+{
+	guththila_attribute_t *att = NULL;
+	att =
+        (guththila_attribute_t *) AXIS2_MALLOC(env->allocator,
+                sizeof (guththila_attribute_t));
+    att->name = name;
+    att->value = value;
+    att->prefix = prefix;
+	att->namespace_uri = namespace_uri;
+	return att;
+}
+
+AXIS2_EXTERN void AXIS2_CALL
+guththila_attribute_free (
+	axis2_env_t *env,
+	guththila_attribute_t *attribute)
+{
+	if (attribute)
+	{
+		if (attribute->prefix)
+			guththila_token_free (env, attribute->prefix);
+		if (attribute->name)
+			guththila_token_free (env, attribute->name);
+		if (attribute->value)
+			guththila_token_free (env, attribute->value);
+		if (attribute->namespace_uri)
+			guththila_token_free (env, attribute->namespace_uri);
+		AXIS2_FREE (env->allocator, attribute);
+		attribute = NULL;
+	}
+}
+



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org