axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Senaka Fernando (JIRA)" <>
Subject [jira] Commented: (AXIS2C-872) Function axiom_document_create[Alastair FETTES]
Date Sat, 05 Jan 2008 05:26:34 GMT


Senaka Fernando commented on AXIS2C-872:

Hi again,

Actually, the builder creates the document and then frees it. However, if you create a document
and free the builder then the document refers to a non-existent object. This can be avoided
by applying the proposed patch.


> Function axiom_document_create[Alastair FETTES]
> -----------------------------------------------
>                 Key: AXIS2C-872
>                 URL:
>             Project: Axis2-C
>          Issue Type: Bug
>         Environment: Ubuntu 7.04
>            Reporter: Lahiru Gunathilake
>         Attachments: diff.txt
> <snippet>
> axiom_document_t* axiom_document_create(
>         const axutil_env_t*     env,
>         axiom_node_t*           root,
>         axiom_stax_builder_t*   builder)
> </snippet>
> Problem: The return value of type axiom_document_t* takes responsibility for the memory
allocated for root. Any child node that is added to root will be free-ed when the function
axiom_document_free is called. The return value of type axiom_document_t* does not takes responsibility
for the memory allocated for builder (as of v1.1.0, this seems odd, since the internal structure
maintains a pointer to builder, but does not free builder. So this may create a dangling pointer
> Solution: Document memory ownership for parameters and return value.  Investigate use
of pointers in internal structure.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

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

View raw message