summaryrefslogtreecommitdiffstats
path: root/axiom/src/om
diff options
context:
space:
mode:
authorGravatar shankar2010-04-05 11:15:30 +0000
committerGravatar shankar2010-04-05 11:15:30 +0000
commit1c90aa45f7cdbfa4bbbb2665bdeb209cb28dfaca (patch)
tree6d0c454b90aa53ae0b23d6562b6f79e38e6f0b63 /axiom/src/om
parent6a4307a3703b0a19abe728266deea5381145dadb (diff)
downloadaxis2c-1c90aa45f7cdbfa4bbbb2665bdeb209cb28dfaca.tar.gz
axis2c-1c90aa45f7cdbfa4bbbb2665bdeb209cb28dfaca.tar.bz2
Fixing memory leaks
git-svn-id: http://svn.apache.org/repos/asf/axis/axis2/c/core/trunk@930840 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'axiom/src/om')
-rw-r--r--axiom/src/om/om_node.c12
-rw-r--r--axiom/src/om/om_stax_builder.c4
2 files changed, 10 insertions, 6 deletions
diff --git a/axiom/src/om/om_node.c b/axiom/src/om/om_node.c
index eb2a50e..50aac77 100644
--- a/axiom/src/om/om_node.c
+++ b/axiom/src/om/om_node.c
@@ -189,6 +189,12 @@ axiom_node_free_detached_subtree(
}
}
+ /* if the owner of the builder, then free the builder */
+ if(om_node->own_builder)
+ {
+ axiom_stax_builder_free_internal(om_node->builder, env);
+ }
+
AXIS2_FREE(env->allocator, om_node);
}
@@ -210,12 +216,6 @@ axiom_node_free_tree(
/* Detach this node before freeing it and its subtree. */
axiom_node_detach_without_namespaces(om_node, env);
- /* if the owner of the builder, then free the builder */
- if(om_node->own_builder)
- {
- axiom_stax_builder_free_internal(om_node->builder, env);
- }
-
/* Free this node and its subtree */
axiom_node_free_detached_subtree(om_node, env);
}
diff --git a/axiom/src/om/om_stax_builder.c b/axiom/src/om/om_stax_builder.c
index ddd6f0e..c43fd61 100644
--- a/axiom/src/om/om_stax_builder.c
+++ b/axiom/src/om/om_stax_builder.c
@@ -153,6 +153,10 @@ axiom_stax_builder_free_self(
{
axiom_node_assume_builder_ownership(om_builder->root_node, env);
}
+ else
+ {
+ axiom_stax_builder_free_internal(om_builder, env);
+ }
}
/**