axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Pararas <>
Subject Leaks in code generated by WSDL2c
Date Fri, 02 Mar 2012 22:35:14 GMT
We have found a number of memory leaks in the code generated by WSDL2c

Here they are:
1.    Looping though a hash table ...  The typical code is:
                        for (hi = axutil_hash_first(attribute_hash, 
env); hi; hi = axutil_hash_next(env, hi))
                            axutil_hash_this(hi, &key, NULL, &val);

                                if(!strcmp((axis2_char_t*)key, "result"))

                                    parent_attri = (axiom_attribute_t*)val;
This works fine unless the "break" occurs.  in that case the "hi" 
allocated in "axutil_hash_first" leaks.  The remedy is to add
              AXIS2_FREE(env->allocator, hi);
before the "break;" inside the loop or  to add
                if (hi) {
                  AXIS2_FREE(env->allocator, hi);
at the end of the loop.

2.    Memory allocated in axutil_qname_create we found this in the 
function "axis2_stub_populate_services_for_XXX"
        (XXX is the name of our specific application service)

the generated code reads:
          svc_qname = axutil_qname_create(env,"XXX" ,NULL, NULL);
          axis2_svc_set_qname (svc, env, svc_qname);

it should be followed by:
to fix the leak
This also occurs in "adb_YYY_create" (YYY being one of the nodes in our 
XML tree) but i may exist elsewhere as well.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message