orbit-small.c patch
- From: Frank Rehberger <Frank Rehberger web de>
- To: "orbit-list gnome org" <orbit-list gnome org>
- Subject: orbit-small.c patch
- Date: Tue, 10 Jun 2003 23:54:32 +0200
Hello,
implementing and testing 'badcall' example for "beginners doc"
(http://www.gnome.org/projects/ORBit2/orbit-docs.tar.gz)
I observed a memory leak in orbit-small.c. This new example floods the
calling CORBA client with user-exceptions:
If skeleton-implementation (badcall-sleimpl.c) raises exception the
memory allocated for arguments has not been CORBA_free'd on return.
This patch removes two guards, so the memory is free'd in any case.
As this patch assumes that servant-operations return valid values and
out-arguments it might have impact on existing servant-implementations,
that handle return values lazy in case of exceptions.
What do you think?
Best regards, Frank
? test/poa/poatest-basic11
Index: src/orb/orb-core/orbit-small.c
===================================================================
RCS file: /cvs/gnome/ORBit2/src/orb/orb-core/orbit-small.c,v
retrieving revision 1.88
diff -c -r1.88 orbit-small.c
*** src/orb/orb-core/orbit-small.c 9 Jun 2003 10:12:26 -0000 1.88
--- src/orb/orb-core/orbit-small.c 10 Jun 2003 21:00:25 -0000
***************
*** 933,940 ****
giop_send_buffer_write (send_buffer, recv_buffer->connection, FALSE);
giop_send_buffer_unuse (send_buffer);
! if (m_data->ret && tc->kind != CORBA_tk_void &&
! ev->_major == CORBA_NO_EXCEPTION) {
switch (m_data->ret->kind) {
case BASE_TYPES:
break;
--- 933,939 ----
giop_send_buffer_write (send_buffer, recv_buffer->connection, FALSE);
giop_send_buffer_unuse (send_buffer);
! if (m_data->ret && tc->kind != CORBA_tk_void) {
switch (m_data->ret->kind) {
case BASE_TYPES:
break;
***************
*** 993,999 ****
ORBit_free (args [i]);
break;
}
! } else if (ev->_major == CORBA_NO_EXCEPTION) { /* Out */
switch (tc->kind) {
case BASE_TYPES:
break;
--- 992,998 ----
ORBit_free (args [i]);
break;
}
! } else { /* Out */
switch (tc->kind) {
case BASE_TYPES:
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]