Return-Path: Delivered-To: apmail-ws-axis-dev-archive@www.apache.org Received: (qmail 71702 invoked from network); 13 Nov 2006 02:14:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Nov 2006 02:14:04 -0000 Received: (qmail 62015 invoked by uid 500); 13 Nov 2006 02:14:11 -0000 Delivered-To: apmail-ws-axis-dev-archive@ws.apache.org Received: (qmail 61909 invoked by uid 500); 13 Nov 2006 02:14:11 -0000 Mailing-List: contact axis-cvs-help@ws.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-cvs@ws.apache.org Received: (qmail 61898 invoked by uid 500); 13 Nov 2006 02:14:11 -0000 Delivered-To: apmail-ws-axis2-cvs@ws.apache.org Received: (qmail 61895 invoked by uid 99); 13 Nov 2006 02:14:11 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Nov 2006 18:14:11 -0800 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME,UPPERCASE_25_50 X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 12 Nov 2006 18:14:00 -0800 Received: by eris.apache.org (Postfix, from userid 65534) id 905341A9846; Sun, 12 Nov 2006 18:13:30 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r474111 - /webservices/axis2/trunk/c/modules/core/description/op.c Date: Mon, 13 Nov 2006 02:13:30 -0000 To: axis2-cvs@ws.apache.org From: samisa@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061113021330.905341A9846@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: samisa Date: Sun Nov 12 18:13:29 2006 New Revision: 474111 URL: http://svn.apache.org/viewvc?view=rev&rev=474111 Log: Fixed memory leaks - AXIS2C-387 Modified: webservices/axis2/trunk/c/modules/core/description/op.c Modified: webservices/axis2/trunk/c/modules/core/description/op.c URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/c/modules/core/description/op.c?view=diff&rev=474111&r1=474110&r2=474111 ============================================================================== --- webservices/axis2/trunk/c/modules/core/description/op.c (original) +++ webservices/axis2/trunk/c/modules/core/description/op.c Sun Nov 12 18:13:29 2006 @@ -31,7 +31,7 @@ axis2_wsdl_op_t *wsdl_op; int mep; - /*To store deploy time module QNames */ + /* to store deploy time module QNames */ axis2_array_list_t *module_qnames; axis2_array_list_t *engaged_module_list; axis2_bool_t from_module; @@ -365,8 +365,6 @@ axis2_array_list_t *array_list_l = NULL; axis2_op_impl_t *op_impl = NULL; axis2_status_t status = AXIS2_FAILURE; - axis2_phase_t *message_processing = NULL; - axis2_phase_t *message_out = NULL; axis2_property_t *property = NULL; axis2_msg_t *msg = NULL; @@ -461,64 +459,12 @@ AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); return NULL; } - /* Set the function pointers of the base */ + /* set function pointers of base */ op_impl->op.base.ops = AXIS2_MALLOC(env->allocator, sizeof(axis2_wsdl_op_ops_t)); op_impl->op.base.ops->free_void_arg = axis2_op_free_void_arg; op_impl->op.base.ops->get_qname = axis2_op_get_qname; - message_processing = axis2_phase_create(env, AXIS2_PHASE_MESSAGE_PROCESSING); - if (op_impl->base) - { - axis2_msg_t *msg = NULL; - msg = AXIS2_DESC_GET_CHILD(op_impl->base, env, AXIS2_MSG_IN); - if (msg) - { - axis2_array_list_t *list = AXIS2_MSG_GET_FLOW(msg, env); - if (list) - { - status = AXIS2_ARRAY_LIST_ADD(list, env, - message_processing); - } - else - { - status = AXIS2_FAILURE; - } - } - } - if (AXIS2_SUCCESS != status) - { - AXIS2_PHASE_FREE(message_processing, env); - message_processing = NULL; - return NULL; - } - message_processing = NULL; - message_out = axis2_phase_create(env, AXIS2_PHASE_MESSAGE_OUT); - if (op_impl->base) - { - axis2_msg_t *msg = NULL; - msg = AXIS2_DESC_GET_CHILD(op_impl->base, env, AXIS2_MSG_OUT); - if (msg) - { - axis2_array_list_t *list = AXIS2_MSG_GET_FLOW(msg, env); - if (list) - { - status = AXIS2_ARRAY_LIST_ADD(list, env, - message_out); - } - else - { - status = AXIS2_FAILURE; - } - } - } - if (AXIS2_SUCCESS != status) - { - AXIS2_PHASE_FREE(message_out, env); - message_out = NULL; - return NULL; - } - message_out = NULL; axis2_op_set_msg_exchange_pattern(&(op_impl->op), env, (axis2_char_t *) AXIS2_MEP_URI_IN_OUT); @@ -541,7 +487,12 @@ } array_list_l = axis2_array_list_create(env, 0); - if (NULL == array_list_l) return NULL; + if (NULL == array_list_l) + { + axis2_op_free(&(op_impl->op), env); + return NULL; + } + property = axis2_property_create(env); AXIS2_PROPERTY_SET_FREE_FUNC(property, env, axis2_array_list_free_void_arg); @@ -1051,12 +1002,6 @@ AXIS2_PARAM_CHECK(env->error, conf, AXIS2_FAILURE); op_impl = AXIS2_INTF_TO_IMPL(op); - /*property = (axis2_property_t *) - AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(op_impl->wsdl_op-> - extensible_component->wsdl_component, env, AXIS2_MODULEREF_KEY);*/ - /* collection_module is the already engaged modules */ - /*collection_module = (axis2_array_list_t *) - AXIS2_PROPERTY_GET_VALUE(property, env);*/ collection_module = op_impl->engaged_module_list; if (collection_module) size = AXIS2_ARRAY_LIST_SIZE(collection_module, env); @@ -1134,13 +1079,6 @@ AXIS2_PARAM_CHECK(env->error, module_desc, AXIS2_FAILURE); op_impl = AXIS2_INTF_TO_IMPL(op); - /*property = (axis2_property_t *) - AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(op_impl->wsdl_op-> - extensible_component->wsdl_component, env, AXIS2_MODULEREF_KEY); - - collection_module = (axis2_array_list_t *) AXIS2_PROPERTY_GET_VALUE( - property, env); - */ if (!op_impl->engaged_module_list) { op_impl->engaged_module_list = axis2_array_list_create(env, 0); @@ -1178,11 +1116,6 @@ AXIS2_ENV_CHECK(env, NULL); op_impl = AXIS2_INTF_TO_IMPL(op); - /*property = (axis2_property_t *) - AXIS2_WSDL_COMPONENT_GET_COMPONENT_PROPERTY(op_impl->wsdl_op-> - extensible_component->wsdl_component, env, AXIS2_MODULEREF_KEY); - modules = (axis2_array_list_t *) AXIS2_PROPERTY_GET_VALUE(property, env); - return modules;*/ return op_impl->engaged_module_list; } @@ -2025,3 +1958,4 @@ AXIS2_ENV_CHECK(env, AXIS2_FAILURE); return AXIS2_INTF_TO_IMPL(op)->from_module; } + --------------------------------------------------------------------- To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org For additional commands, e-mail: axis-cvs-help@ws.apache.org