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 mi...@apache.org on 2008/04/21 16:49:47 UTC
svn commit: r650162 - in /webservices/axis2/trunk/c/guththila/src:
guththila_reader.c guththila_xml_parser.c
Author: milinda
Date: Mon Apr 21 07:49:44 2008
New Revision: 650162
URL: http://svn.apache.org/viewvc?rev=650162&view=rev
Log:
Fixed some memory leaks in guththila.
Modified:
webservices/axis2/trunk/c/guththila/src/guththila_reader.c
webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c
Modified: webservices/axis2/trunk/c/guththila/src/guththila_reader.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_reader.c?rev=650162&r1=650161&r2=650162&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_reader.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_reader.c Mon Apr 21 07:49:44 2008
@@ -84,6 +84,10 @@
{
fclose(r->fp);
}
+ if (r->type == GUTHTHILA_IO_READER && r->context)
+ {
+ AXIS2_FREE(env->allocator, r->context);
+ }
AXIS2_FREE(env->allocator, r);
}
Modified: webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c?rev=650162&r1=650161&r2=650162&view=diff
==============================================================================
--- webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c (original)
+++ webservices/axis2/trunk/c/guththila/src/guththila_xml_parser.c Mon Apr 21 07:49:44 2008
@@ -252,8 +252,7 @@
GUTHTHILA_EXPORT void GUTHTHILA_CALL
guththila_free(guththila_t * m, const axutil_env_t * env)
{
- int size = 0,
- i = 0;
+ int size = 0, i = 0, j = 0;
guththila_attr_t * attr = NULL;
guththila_element_t* elem = NULL;
guththila_elem_namesp_t * e_namesp = NULL;
@@ -337,15 +336,15 @@
{
e_namesp =
(guththila_elem_namesp_t *) guththila_stack_pop(&m->namesp, env);
- for (i = 0; i < e_namesp->no; i++)
+ for (j = 0; j < e_namesp->no; j++)
{
- if(e_namesp->namesp[i].name)
+ if(e_namesp->namesp[j].name)
{
- guththila_tok_list_release_token(&m->tokens,e_namesp->namesp[i].name,env);
+ guththila_tok_list_release_token(&m->tokens,e_namesp->namesp[j].name,env);
}
- if(e_namesp->namesp[i].uri)
+ if(e_namesp->namesp[j].uri)
{
- guththila_tok_list_release_token(&m->tokens,e_namesp->namesp[i].uri, env);
+ guththila_tok_list_release_token(&m->tokens,e_namesp->namesp[j].uri, env);
}
}
AXIS2_FREE(env->allocator, e_namesp->namesp);
@@ -362,8 +361,7 @@
GUTHTHILA_EXPORT int GUTHTHILA_CALL
guththila_un_init(guththila_t * m,const axutil_env_t * env)
{
- int size = 0,
- i = 0;
+ int size = 0, i = 0, j = 0;
guththila_attr_t * attr = NULL;
guththila_element_t* elem = NULL;
guththila_elem_namesp_t * e_namesp = NULL;
@@ -434,15 +432,15 @@
(guththila_elem_namesp_t *) guththila_stack_pop(&m->namesp, env);
if(e_namesp)
{
- for (i = 0; i < e_namesp->no; i++)
+ for (j = 0; j < e_namesp->no; j++)
{
- if(e_namesp->namesp[i].name)
+ if(e_namesp->namesp[j].name)
{
- guththila_tok_list_release_token(&m->tokens,e_namesp->namesp[i].name,env);
+ guththila_tok_list_release_token(&m->tokens,e_namesp->namesp[j].name,env);
}
- if(e_namesp->namesp[i].uri)
+ if(e_namesp->namesp[j].uri)
{
- guththila_tok_list_release_token(&m->tokens,e_namesp->namesp[i].uri, env);
+ guththila_tok_list_release_token(&m->tokens,e_namesp->namesp[j].uri, env);
}
}
AXIS2_FREE(env->allocator, e_namesp->namesp);
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org