Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-670

Freeing nodes at axis2_svc_client_remove_all_headers cause double free

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.1.0
    • None
    • None

    Description

      I reuse service client and before each reuse I need to remove all headers to avoid repeated entry of http headers.
      When doing this I get the following valgrind report

      ==4463== Invalid read of size 4
      ==4463== at 0x402C7AA: axiom_node_detach (om_node.c:214)
      ==4463== by 0x402C492: axiom_node_free_tree (om_node.c:100)
      ==4463== by 0x402C4AD: axiom_node_free_tree (om_node.c:103)
      ==4463== by 0x403F825: axiom_soap_envelope_free (soap_envelope.c:167)
      ==4463== by 0x806F20A: axis2_msg_ctx_free (msg_ctx.c:327)
      ==4463== by 0x8070FEF: axis2_op_ctx_free (op_ctx.c:145)
      ==4463== by 0x42076A3: axis2_op_client_free (op_client.c:582)
      ==4463== by 0x420A50C: axis2_svc_client_create_op_client (svc_client.c:900)
      ==4463== by 0x4209FF4: axis2_svc_client_send_receive_with_op_qname (svc_client.c:732)
      ==4463== by 0x420A225: axis2_svc_client_send_receive (svc_client.c:804)
      ==4463== by 0x44E449D: savan_util_get_subscriber_list_from_remote_subs_mgr (savan_util.c:854)
      ==4463== by 0x45FC503: process_presence (monitor.c:547)
      ==4463== Address 0x579920C is 12 bytes inside a block of size 40 free'd
      ==4463== at 0x401CFA5: free (vg_replace_malloc.c:233)
      ==4463== by 0x418DFF8: axutil_allocator_free_impl (allocator.c:77)
      ==4463== by 0x402C598: axiom_node_free_tree (om_node.c:141)
      ==4463== by 0x4209818: axis2_svc_client_remove_all_headers (svc_client.c:486)
      ==4463== by 0x45FC08E: wsfes_monitor_presence (monitor.c:442)
      ==4463== by 0x45FCF53: wsfes_monitor_invoke (monitor_skel.c:170)
      ==4463== by 0x41EDF28: axis2_raw_xml_in_out_msg_recv_invoke_business_logic_sync (raw_xml_in_out_msg_recv.c:209)
      ==4463== by 0x41ED80E: axis2_msg_recv_invoke_business_logic (msg_recv.c:375)
      ==4463== by 0x41ED616: axis2_msg_recv_receive_impl (msg_recv.c:307)
      ==4463== by 0x41ED86A: axis2_msg_recv_receive (msg_recv.c:410)
      ==4463== by 0x41E12DD: axis2_engine_receive (engine.c:288)
      ==4463== by 0x41BD73F: axis2_http_transport_utils_process_http_post_request (http_transport_utils.c:489)

      So I commented as in the following to solve the problem

      for (i = 0; i < size; i++)
      {
      /*axiom_node_t *node = NULL;
      node = axutil_array_list_get(svc_client->headers, env, i);

      if (node)

      { axiom_node_free_tree(node, env); node = NULL; }

      */
      axutil_array_list_remove(svc_client->headers, env, i);
      }

      Attachments

        Activity

          People

            damitha Damitha N.M. Kumarage
            damitha Damitha N.M. Kumarage
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: