You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Alex Mantaut (JIRA)" <ji...@apache.org> on 2013/11/15 21:13:21 UTC
[jira] [Commented] (AXIS2C-1650) memory leak xpatch.c
[ https://issues.apache.org/jira/browse/AXIS2C-1650?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13824042#comment-13824042 ]
Alex Mantaut commented on AXIS2C-1650:
--------------------------------------
Hi Jean-Marc:
I've tried your patch, and when I run axiom/test/xpath/test_xpath with valgrind I get the a memory error that wasn't there previously (not a leak):
==17910== Invalid free() / delete / delete[] / realloc()
==17910== at 0x4028D3D: free (vg_replace_malloc.c:446)
==17910== by 0x4056E7A: axutil_allocator_free_impl (allocator.c:116)
==17910== by 0x40B6EFD: axiom_xpath_free_context (xpath.c:405)
==17910== by 0x8048ECC: main (test_xpath.c:119)
==17910== Address 0x4295e60 is 0 bytes inside a block of size 40 free'd
==17910== at 0x4028D3D: free (vg_replace_malloc.c:446)
==17910== by 0x4056E7A: axutil_allocator_free_impl (allocator.c:116)
==17910== by 0x4083DB1: axiom_node_free_detached_subtree (om_node.c:198)
==17910== by 0x40B6E95: axiom_xpath_free_context (xpath.c:384)
==17910== by 0x8048ECC: main (test_xpath.c:119)
Also I looked into the code and the only calls to axiom_xpath_free_context() are in this test, are you having leaks while using it?
> memory leak xpatch.c
> --------------------
>
> Key: AXIS2C-1650
> URL: https://issues.apache.org/jira/browse/AXIS2C-1650
> Project: Axis2-C
> Issue Type: Bug
> Components: xml/om
> Affects Versions: 1.7.0
> Environment: AIX 6.1 xlc_r
> Reporter: Jean-Marc Lamond
> Attachments: xpath.c.patch
>
>
> context->attribute not free in axiom_xpath_free_context.
> env->dummy_root
> "
> /*HACK: xpath impl requires a dummy root node in order to process properly.*/
> axiom_node_t * dummy_root;
> dummy_root = axiom_node_create(env);
> axiom_node_add_child(dummy_root, env, root_node);
> context = AXIS2_MALLOC(env->allocator,
> sizeof(axiom_xpath_context_t));
> "
> should also be free.
> attached patch file.
--
This message was sent by Atlassian JIRA
(v6.1#6144)
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org