[ 
https://issues.apache.org/jira/browse/AXIS2C-1447?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Lazarski resolved AXIS2C-1447.
-------------------------------------
    Fix Version/s: 2.0.0
                       (was: 1.7.0)
       Resolution: Fixed

  
    axutil_hash_free() and axutil_hash_free_void_arg() were freeing memory
    using the env parameter passed to the function. This could cause memory
    corruption if a different env (with a different allocator) was passed
    than the one used when the hash table was created.
    
    Fix: Use ht->env (the allocator stored during hash creation) for all
    memory free operations. Fall back to the passed env only if ht->env
    is NULL.
    
    Also fixes:
    - axutil_hash_free_void_arg() was using i < ht->max instead of
      i <= ht->max, which could miss freeing entries in the last bucket
    - axutil_hash_free_void_arg() was missing the ht->env cleanup that
      releases the reference count on the stored env
    


> axutil_hash_free() should free using ht->env
> --------------------------------------------
>
>                 Key: AXIS2C-1447
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1447
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: util
>    Affects Versions: 1.6.0
>            Reporter: Olivier Mengué
>            Priority: Minor
>             Fix For: 2.0.0
>
>
> Currently axutil_hash_free() frees memory using the 'env' arg. Instead it 
> should use the same allocator that was used for allocation. This allocation 
> is stored in the 'env' member (ht->env).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to