Logo Search packages:      
Sourcecode: sofia-sip version File versions  Download package

SU_DLL void su_free ( su_home_t home,
void *  data 

Free a memory block.

Frees a single memory block. The home must be the owner of the memory block (usually the memory home used to allocate the memory block, or NULL if no home was used).

home pointer to home object
data pointer to the memory block to be freed

Definition at line 789 of file su_alloc.c.

References su_free().

Referenced by auc_copy_credentials(), auc_credentials(), auth_digest_challenge_free_params(), auth_mod_addpass(), forwarder_empty(), msg_any_list_d(), msg_as_string(), msg_avlist_d(), msg_buf_external(), msg_header_copy_as(), msg_header_d(), msg_header_dup_as(), msg_header_dup_one(), msg_header_free(), msg_header_free_all(), msg_header_join_items(), msg_header_make(), msg_header_vformat(), msg_multipart_create(), nea_destroy(), nea_server_free_subscribers(), nea_sub_process_subscribe(), nea_update(), nea_view_dequeue(), nea_view_destroy(), nea_view_queue(), nta_agent_add_tport(), nta_leg_by_dialog(), nta_leg_by_uri(), nta_leg_tcreate(), priv_lookup_cb(), sdp_printer_free(), sip_contact_create_from_via_with_transport(), sip_headers_as_url_query(), sip_url_query_as_taglist(), soa_base_generate_answer(), soa_base_process_answer(), soa_base_set_params(), soa_description_free(), soa_description_set(), soa_error_as_sip_reason(), sres_cache_free_record(), sres_resolver_update(), stun_dns_lookup(), stun_handle_destroy(), su_free(), su_home_unref(), su_msg_destroy(), su_realloc(), su_root_destroy(), su_timer_destroy(), su_vsprintf(), test_dup(), tport_name_by_url(), tport_open_log(), url_format(), url_hdup(), url_map_find(), url_map_new(), and url_query_as_header_string().

  if (!data)

  if (home) {
    su_alloc_t *allocation;
    su_block_t *sub = MEMLOCK(home);

    allocation = su_block_find(sub, data);

    if (su_alloc_check(sub, allocation)) {
      void *preloaded = NULL;

      /* Is this preloaded data? */
      if (su_is_preloaded(sub, data))
      preloaded = data;

      if (sub->sub_stats)
      su_home_stats_free(sub, data, preloaded, allocation->sua_size);

      if (allocation->sua_home) {
      su_home_t *subhome = data;
      su_block_t *sub = MEMLOCK(subhome);

      assert(sub->sub_ref != REF_MAX);
      /* assert(sub->sub_ref > 0); */

      sub->sub_ref = 0; /* Zap all references */


#if MEMCHECK != 0
      memset(data, 0xaa, (size_t)allocation->sua_size);

      memset(allocation, 0, sizeof (*allocation));

      if (preloaded)
      data = NULL;



Generated by  Doxygen 1.6.0   Back to index