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 "Daniel Stine (JIRA)" <ji...@apache.org> on 2012/07/11 21:05:34 UTC
[jira] [Created] (AXIS2C-1602) memory leaks in xpath expressions
Daniel Stine created AXIS2C-1602:
------------------------------------
Summary: memory leaks in xpath expressions
Key: AXIS2C-1602
URL: https://issues.apache.org/jira/browse/AXIS2C-1602
Project: Axis2-C
Issue Type: Bug
Components: xml/om
Affects Versions: 1.6.0
Environment: Windows XP, MSVS 2008
Reporter: Daniel Stine
axiom_xpath_free_expression doesn't free the parameters of the operations. At least the following code is needed:
if (xpath_expr->operations)
{
num = axutil_array_list_size(xpath_expr->operations, env);
for (i=0; i<num; i++) {
op = (axiom_xpath_operation_t *) axutil_array_list_get(xpath_expr->operations, env, i);
if (op->par1) {
node_test = (axiom_xpath_node_test_t *)op->par1;
if (node_test->prefix) AXIS2_FREE(env->allocator, node_test->prefix);
if (node_test->name) AXIS2_FREE(env->allocator, node_test->name);
if (node_test->lit) AXIS2_FREE(env->allocator, node_test->lit);
AXIS2_FREE(env->allocator, op->par1);
}
if (op->par2) AXIS2_FREE(env->allocator, op->par2);
AXIS2_FREE(env->allocator, op);
}
axutil_array_list_free(xpath_expr->operations, env);
xpath_expr->operations = NULL;
}
------------------
An strdup of a name is left unfreed in axiom_xpath_compile_step in the else clause.
name = axiom_xpath_compile_ncname(env, expr);
if (name)
{
AXIOM_XPATH_SKIP_WHITESPACES;
/* An axis */
if (AXIOM_XPATH_CURRENT == ':' && AXIOM_XPATH_NEXT(1) == ':')
{
[..snip..]
}
else
{
AXIS2_FREE(env->allocator, name); <----- NEEDED
axis = AXIOM_XPATH_AXIS_CHILD;
expr->expr_ptr = temp_ptr;
}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org
[jira] [Assigned] (AXIS2C-1602) memory leaks in xpath
Posted by "Nandika Jayawardana (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2C-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nandika Jayawardana reassigned AXIS2C-1602:
-------------------------------------------
Assignee: Nandika Jayawardana
> memory leaks in xpath
> ---------------------
>
> Key: AXIS2C-1602
> URL: https://issues.apache.org/jira/browse/AXIS2C-1602
> Project: Axis2-C
> Issue Type: Bug
> Components: xml/om
> Affects Versions: 1.6.0
> Environment: Windows XP, MSVS 2008
> Reporter: Daniel Stine
> Assignee: Nandika Jayawardana
> Labels: axiom, expression, leak, xpath
>
> xpath.c :: axiom_xpath_free_expression doesn't free the parameters of the operations. At least the following code is needed:
> if (xpath_expr->operations)
> {
> num = axutil_array_list_size(xpath_expr->operations, env);
> for (i=0; i<num; i++) {
> op = (axiom_xpath_operation_t *) axutil_array_list_get(xpath_expr->operations, env, i);
> if (op->par1) {
> node_test = (axiom_xpath_node_test_t *)op->par1;
> if (node_test->prefix) AXIS2_FREE(env->allocator, node_test->prefix);
> if (node_test->name) AXIS2_FREE(env->allocator, node_test->name);
> if (node_test->lit) AXIS2_FREE(env->allocator, node_test->lit);
> AXIS2_FREE(env->allocator, op->par1);
> }
> if (op->par2) AXIS2_FREE(env->allocator, op->par2);
> AXIS2_FREE(env->allocator, op);
> }
> axutil_array_list_free(xpath_expr->operations, env);
> xpath_expr->operations = NULL;
> }
> ------------------
> xpath.c :: axiom_xpath_free_result doesn't free the nodes from the result array list. At least the following is needed:
> if (result->nodes)
> {
> num = axutil_array_list_size(result->nodes, env);
> for (i=0; i<num; i++) {
> node = (axiom_xpath_result_node_t *) axutil_array_list_get(result->nodes, env, i);
> AXIS2_FREE(context->env->allocator, node);
> }
> axutil_array_list_free(result->nodes, env);
> }
> ------------------
> xpath_internals_parser.c :: A strdup of a name is left unfreed in axiom_xpath_compile_step in the else clause.
> name = axiom_xpath_compile_ncname(env, expr);
> if (name)
> {
> AXIOM_XPATH_SKIP_WHITESPACES;
> /* An axis */
> if (AXIOM_XPATH_CURRENT == ':' && AXIOM_XPATH_NEXT(1) == ':')
> {
> [..snip..]
> }
> else
> {
> AXIS2_FREE(env->allocator, name); <----- NEEDED
> axis = AXIOM_XPATH_AXIS_CHILD;
> expr->expr_ptr = temp_ptr;
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org
[jira] [Updated] (AXIS2C-1602) memory leaks in xpath
Posted by "Daniel Stine (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/AXIS2C-1602?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Daniel Stine updated AXIS2C-1602:
---------------------------------
Description:
xpath.c :: axiom_xpath_free_expression doesn't free the parameters of the operations. At least the following code is needed:
if (xpath_expr->operations)
{
num = axutil_array_list_size(xpath_expr->operations, env);
for (i=0; i<num; i++) {
op = (axiom_xpath_operation_t *) axutil_array_list_get(xpath_expr->operations, env, i);
if (op->par1) {
node_test = (axiom_xpath_node_test_t *)op->par1;
if (node_test->prefix) AXIS2_FREE(env->allocator, node_test->prefix);
if (node_test->name) AXIS2_FREE(env->allocator, node_test->name);
if (node_test->lit) AXIS2_FREE(env->allocator, node_test->lit);
AXIS2_FREE(env->allocator, op->par1);
}
if (op->par2) AXIS2_FREE(env->allocator, op->par2);
AXIS2_FREE(env->allocator, op);
}
axutil_array_list_free(xpath_expr->operations, env);
xpath_expr->operations = NULL;
}
------------------
xpath.c :: axiom_xpath_free_result doesn't free the nodes from the result array list. At least the following is needed:
if (result->nodes)
{
num = axutil_array_list_size(result->nodes, env);
for (i=0; i<num; i++) {
node = (axiom_xpath_result_node_t *) axutil_array_list_get(result->nodes, env, i);
AXIS2_FREE(context->env->allocator, node);
}
axutil_array_list_free(result->nodes, env);
}
------------------
xpath_internals_parser.c :: A strdup of a name is left unfreed in axiom_xpath_compile_step in the else clause.
name = axiom_xpath_compile_ncname(env, expr);
if (name)
{
AXIOM_XPATH_SKIP_WHITESPACES;
/* An axis */
if (AXIOM_XPATH_CURRENT == ':' && AXIOM_XPATH_NEXT(1) == ':')
{
[..snip..]
}
else
{
AXIS2_FREE(env->allocator, name); <----- NEEDED
axis = AXIOM_XPATH_AXIS_CHILD;
expr->expr_ptr = temp_ptr;
}
was:
axiom_xpath_free_expression doesn't free the parameters of the operations. At least the following code is needed:
if (xpath_expr->operations)
{
num = axutil_array_list_size(xpath_expr->operations, env);
for (i=0; i<num; i++) {
op = (axiom_xpath_operation_t *) axutil_array_list_get(xpath_expr->operations, env, i);
if (op->par1) {
node_test = (axiom_xpath_node_test_t *)op->par1;
if (node_test->prefix) AXIS2_FREE(env->allocator, node_test->prefix);
if (node_test->name) AXIS2_FREE(env->allocator, node_test->name);
if (node_test->lit) AXIS2_FREE(env->allocator, node_test->lit);
AXIS2_FREE(env->allocator, op->par1);
}
if (op->par2) AXIS2_FREE(env->allocator, op->par2);
AXIS2_FREE(env->allocator, op);
}
axutil_array_list_free(xpath_expr->operations, env);
xpath_expr->operations = NULL;
}
------------------
An strdup of a name is left unfreed in axiom_xpath_compile_step in the else clause.
name = axiom_xpath_compile_ncname(env, expr);
if (name)
{
AXIOM_XPATH_SKIP_WHITESPACES;
/* An axis */
if (AXIOM_XPATH_CURRENT == ':' && AXIOM_XPATH_NEXT(1) == ':')
{
[..snip..]
}
else
{
AXIS2_FREE(env->allocator, name); <----- NEEDED
axis = AXIOM_XPATH_AXIS_CHILD;
expr->expr_ptr = temp_ptr;
}
Summary: memory leaks in xpath (was: memory leaks in xpath expressions)
> memory leaks in xpath
> ---------------------
>
> Key: AXIS2C-1602
> URL: https://issues.apache.org/jira/browse/AXIS2C-1602
> Project: Axis2-C
> Issue Type: Bug
> Components: xml/om
> Affects Versions: 1.6.0
> Environment: Windows XP, MSVS 2008
> Reporter: Daniel Stine
> Labels: axiom, expression, leak, xpath
>
> xpath.c :: axiom_xpath_free_expression doesn't free the parameters of the operations. At least the following code is needed:
> if (xpath_expr->operations)
> {
> num = axutil_array_list_size(xpath_expr->operations, env);
> for (i=0; i<num; i++) {
> op = (axiom_xpath_operation_t *) axutil_array_list_get(xpath_expr->operations, env, i);
> if (op->par1) {
> node_test = (axiom_xpath_node_test_t *)op->par1;
> if (node_test->prefix) AXIS2_FREE(env->allocator, node_test->prefix);
> if (node_test->name) AXIS2_FREE(env->allocator, node_test->name);
> if (node_test->lit) AXIS2_FREE(env->allocator, node_test->lit);
> AXIS2_FREE(env->allocator, op->par1);
> }
> if (op->par2) AXIS2_FREE(env->allocator, op->par2);
> AXIS2_FREE(env->allocator, op);
> }
> axutil_array_list_free(xpath_expr->operations, env);
> xpath_expr->operations = NULL;
> }
> ------------------
> xpath.c :: axiom_xpath_free_result doesn't free the nodes from the result array list. At least the following is needed:
> if (result->nodes)
> {
> num = axutil_array_list_size(result->nodes, env);
> for (i=0; i<num; i++) {
> node = (axiom_xpath_result_node_t *) axutil_array_list_get(result->nodes, env, i);
> AXIS2_FREE(context->env->allocator, node);
> }
> axutil_array_list_free(result->nodes, env);
> }
> ------------------
> xpath_internals_parser.c :: A strdup of a name is left unfreed in axiom_xpath_compile_step in the else clause.
> name = axiom_xpath_compile_ncname(env, expr);
> if (name)
> {
> AXIOM_XPATH_SKIP_WHITESPACES;
> /* An axis */
> if (AXIOM_XPATH_CURRENT == ':' && AXIOM_XPATH_NEXT(1) == ':')
> {
> [..snip..]
> }
> else
> {
> AXIS2_FREE(env->allocator, name); <----- NEEDED
> axis = AXIOM_XPATH_AXIS_CHILD;
> expr->expr_ptr = temp_ptr;
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: c-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: c-dev-help@axis.apache.org