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

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

Fix two memory leaks in axis2_http_transport_utils_get_services_static_wsdl:
    
    1. Hash iterator leak: Add axutil_hash_index_free() when breaking early
       from the services hash iteration loop
    
    2. URL tokens leak: Free url_tok array and its contents (url_tok[0],
       url_tok[1]) allocated by axutil_parse_request_url_for_svc_and_op()
    
    Note: The third leak mentioned in the original issue (query_str in
    get_request_params) was already fixed under AXIS2C-1702.
    


> Memory leaks in src/core/transport/http/util/http_transport_utils.c
> -------------------------------------------------------------------
>
>                 Key: AXIS2C-1596
>                 URL: https://issues.apache.org/jira/browse/AXIS2C-1596
>             Project: Axis2-C
>          Issue Type: Bug
>          Components: transport/http
>            Reporter: Ivan Pechorin
>            Priority: Major
>              Labels: patch
>             Fix For: 2.0.0
>
>         Attachments: axis2-c-http_transport_utils.diff
>
>
> There are 3 memory leaks in 
> src/core/transport/http/util/http_transport_utils.c (current SVN trunk):
> 1) query_str is allocated via axutil_strdup() at http_transport_utils.c:1488, 
> but never freed. Should be freed in the end of 
> axis2_http_transport_utils_get_request_params()
> 5 bytes leaked at 0x6000000001419300 (0.06% of all bytes leaked)
> #0  axutil_allocator_malloc_impl() at allocator.c:99
> #1  axutil_strdup() at string.c:267
> #2  axis2_http_transport_utils_get_request_params() at 
> http_transport_utils.c:1488
> #3  axis2_http_worker_process_request() at http_worker.c:484
> 2) A string is allocated by axutil_hash_first() at 
> http_transport_utils.c:1827, but it is not freed.
> 96 bytes leaked in 3 blocks (0.37% of all bytes leaked)
> These range in size from 32 to 32 bytes and are allocated
> #0  axutil_allocator_malloc_impl() at allocator.c:99
> #1  axutil_hash_first() at hash.c:159
> #2  axis2_http_transport_utils_get_services_static_wsdl() at 
> http_transport_utils.c:1827
> #3  axis2_http_worker_process_request() at http_worker.c:563
> 3) axutil_parse_request_url_for_svc_and_op() allocates and returns three 
> chunks of memory that are never freed when called from 
> axis2_http_transport_utils_get_services_static_wsdl() at 
> http_transport_utils.c:1810
> 48 bytes leaked in 3 blocks (0.18% of all bytes leaked)
> These range in size from 16 to 16 bytes and are allocated
> #0  axutil_allocator_malloc_impl() at allocator.c:99
> #1  axutil_parse_request_url_for_svc_and_op() at utils.c:407
> #2  axis2_http_transport_utils_get_services_static_wsdl() at 
> http_transport_utils.c:1810
> #3  axis2_http_worker_process_request() at http_worker.c:563
> 48 bytes leaked in 3 blocks (0.18% of all bytes leaked)
> These range in size from 16 to 16 bytes and are allocated
> #0  axutil_allocator_malloc_impl() at allocator.c:99
> #1  axutil_strdup() at string.c:267
> #2  axutil_parse_request_url_for_svc_and_op() at utils.c:454
> #3  axis2_http_transport_utils_get_services_static_wsdl() at 
> http_transport_utils.c:1810



--
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