You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-commits@axis.apache.org by ro...@apache.org on 2026/01/10 19:48:03 UTC
(axis-axis2-c-core) branch master updated (da3832cd2 -> 74ca7e9c3)
This is an automated email from the ASF dual-hosted git repository.
robertlazarski pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-c-core.git
from da3832cd2 Fix SSL memory leaks (AXIS2C-1388)
new f698dafe8 Fix memory leaks in In-Only message handling (AXIS2C-1204)
new 74ca7e9c3 Fix memory leaks when server returns error (AXIS2C-1214)
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
src/core/receivers/raw_xml_in_out_msg_recv.c | 7 ++++++-
src/core/receivers/svr_callback.c | 16 ++++++++++++++--
src/core/transport/http/server/apache2/apache2_worker.c | 5 +++++
src/core/transport/http/util/http_transport_utils.c | 5 +++++
4 files changed, 30 insertions(+), 3 deletions(-)
(axis-axis2-c-core) 01/02: Fix memory leaks in In-Only message handling (AXIS2C-1204)
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
robertlazarski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-c-core.git
commit f698dafe80dcdd5dc93064c8e4c8d3bc3aa4fa45
Author: Robert Lazarski <ro...@gmail.com>
AuthorDate: Sat Jan 10 09:05:20 2026 -1000
Fix memory leaks in In-Only message handling (AXIS2C-1204)
Fix two memory leaks in axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync:
1. res_name string leak: The dynamically allocated response name string
from axutil_stracat() was not being freed. Now freed in both success
and error paths of RPC response handling.
2. default_envelope leak: When axiom_soap_header_create_with_parent,
axiom_soap_body_create_with_parent, or axiom_soap_body_get_base_node
failed, the function returned without freeing the already-created
SOAP envelope. Added axiom_soap_envelope_free() calls in all three
early return paths.
Co-Authored-By: Claude Opus 4.5 <no...@anthropic.com>
---
src/core/receivers/raw_xml_in_out_msg_recv.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/core/receivers/raw_xml_in_out_msg_recv.c b/src/core/receivers/raw_xml_in_out_msg_recv.c
index 63a8b8cba..a87a5e700 100644
--- a/src/core/receivers/raw_xml_in_out_msg_recv.c
+++ b/src/core/receivers/raw_xml_in_out_msg_recv.c
@@ -241,12 +241,14 @@ axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync(
ns = axiom_namespace_create(env, "http://soapenc/", "res");
if(!ns)
{
+ AXIS2_FREE(env->allocator, res_name);
status = AXIS2_FAILURE;
}
else
{
/*body_content_element = */
- axiom_element_create(env, NULL, res_name, ns, &body_content_node);
+ axiom_element_create(env, NULL, res_name, ns, &body_content_node);
+ AXIS2_FREE(env->allocator, res_name);
axiom_node_add_child(body_content_node, env, result_node);
}
}
@@ -345,18 +347,21 @@ axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync(
out_header = axiom_soap_header_create_with_parent(env, default_envelope);
if(!out_header)
{
+ axiom_soap_envelope_free(default_envelope, env);
return AXIS2_FAILURE;
}
out_body = axiom_soap_body_create_with_parent(env, default_envelope);
if(!out_body)
{
+ axiom_soap_envelope_free(default_envelope, env);
return AXIS2_FAILURE;
}
out_node = axiom_soap_body_get_base_node(out_body, env);
if(!out_node)
{
+ axiom_soap_envelope_free(default_envelope, env);
return AXIS2_FAILURE;
}
(axis-axis2-c-core) 02/02: Fix memory leaks when server returns error (AXIS2C-1214)
Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
robertlazarski pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-c-core.git
commit 74ca7e9c34c63f8072fd996a82accff5ca8f093b
Author: Robert Lazarski <ro...@gmail.com>
AuthorDate: Sat Jan 10 09:20:11 2026 -1000
Fix memory leaks when server returns error (AXIS2C-1214)
Fix engine and fault message context memory leaks in error handling paths:
1. svr_callback.c: axis2_svr_callback_handle_result() was not freeing the
engine after use. axis2_svr_callback_handle_fault() was not freeing
either the engine or the fault_ctx message context.
2. http_transport_utils.c: In axis2_http_transport_utils_process_request(),
when processing fails and a SOAP fault is generated, both engine and
fault_ctx were created but never freed.
3. apache2_worker.c: Same issue in axis2_apache2_worker_process_request()
error handling path - engine and fault_ctx were not freed.
These leaks occurred whenever the server returned an error response,
as reported in the original Jira issue.
Co-Authored-By: Claude Opus 4.5 <no...@anthropic.com>
---
src/core/receivers/svr_callback.c | 16 ++++++++++++++--
src/core/transport/http/server/apache2/apache2_worker.c | 5 +++++
src/core/transport/http/util/http_transport_utils.c | 5 +++++
3 files changed, 24 insertions(+), 2 deletions(-)
diff --git a/src/core/receivers/svr_callback.c b/src/core/receivers/svr_callback.c
index 2fe68b1b6..803194e4b 100644
--- a/src/core/receivers/svr_callback.c
+++ b/src/core/receivers/svr_callback.c
@@ -80,7 +80,11 @@ axis2_svr_callback_handle_result(
{
return AXIS2_FAILURE;
}
- return axis2_engine_send(engine, env, msg_ctx);
+ {
+ axis2_status_t status = axis2_engine_send(engine, env, msg_ctx);
+ axis2_engine_free(engine, env);
+ return status;
+ }
}
AXIS2_EXPORT axis2_status_t AXIS2_CALL
@@ -108,5 +112,13 @@ axis2_svr_callback_handle_fault(
}
fault_ctx = axis2_engine_create_fault_msg_ctx(engine, env, msg_ctx, NULL, NULL);
- return axis2_engine_send_fault(engine, env, fault_ctx);
+ {
+ axis2_status_t status = axis2_engine_send_fault(engine, env, fault_ctx);
+ if(fault_ctx)
+ {
+ axis2_msg_ctx_free(fault_ctx, env);
+ }
+ axis2_engine_free(engine, env);
+ return status;
+ }
}
diff --git a/src/core/transport/http/server/apache2/apache2_worker.c b/src/core/transport/http/server/apache2/apache2_worker.c
index 94e4adc8b..eafc4b752 100644
--- a/src/core/transport/http/server/apache2/apache2_worker.c
+++ b/src/core/transport/http/server/apache2/apache2_worker.c
@@ -945,6 +945,11 @@ axis2_apache2_worker_process_request(
axutil_error_get_message
(env->error));
axis2_engine_send_fault(engine, env, fault_ctx);
+ if(fault_ctx)
+ {
+ axis2_msg_ctx_free(fault_ctx, env);
+ }
+ axis2_engine_free(engine, env);
if (out_stream)
{
body_string = axutil_stream_get_buffer(out_stream, env);
diff --git a/src/core/transport/http/util/http_transport_utils.c b/src/core/transport/http/util/http_transport_utils.c
index db2bf689f..670f54a31 100644
--- a/src/core/transport/http/util/http_transport_utils.c
+++ b/src/core/transport/http/util/http_transport_utils.c
@@ -3219,6 +3219,11 @@ axis2_http_transport_utils_process_request(
fault_code, axutil_error_get_message(env->error));
axis2_engine_send_fault(engine, env, fault_ctx);
+ if(fault_ctx)
+ {
+ axis2_msg_ctx_free(fault_ctx, env);
+ }
+ axis2_engine_free(engine, env);
if (out_stream)
{
response->response_data = axutil_stream_get_buffer(out_stream, env);