Fix resource leak for pthread_cancel() 29/105329/2 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv accepted/tizen_3.0.m2_wearable tizen_3.0.m2 accepted/tizen/3.0.m2/mobile/20170105.023852 accepted/tizen/3.0.m2/tv/20170105.024217 accepted/tizen/3.0.m2/wearable/20170105.024519 accepted/tizen/3.0/common/20161219.113545 accepted/tizen/3.0/ivi/20161219.012808 accepted/tizen/3.0/mobile/20161219.012716 accepted/tizen/3.0/tv/20161219.012736 accepted/tizen/3.0/wearable/20161219.012751 accepted/tizen/common/20161216.124547 accepted/tizen/ivi/20161219.021447 accepted/tizen/mobile/20161219.021348 accepted/tizen/tv/20161219.021409 accepted/tizen/wearable/20161219.021433 submit/tizen/20161216.085540 submit/tizen_3.0.m2/20170104.093752 submit/tizen_3.0/20161216.085435
authormin7.choi <min7.choi@samsung.com>
Fri, 16 Dec 2016 08:19:29 +0000 (17:19 +0900)
committermin7.choi <min7.choi@samsung.com>
Fri, 16 Dec 2016 08:21:08 +0000 (17:21 +0900)
Change-Id: I6563d045f9ff64d16e3ffc4762f4379fa62a48fc
Signed-off-by: min7.choi <min7.choi@samsung.com>
agent/download-agent-http-mgr.c
packaging/download-provider.spec

index 7e84a96..3bdd318 100755 (executable)
@@ -641,6 +641,8 @@ da_ret_t request_to_cancel_http_download(da_info_t *da_info)
        da_ret_t ret = DA_RESULT_OK;
        http_info_t *http_info = DA_NULL;
        http_state_t http_state = 0;
+       int status;
+
        DA_LOGV("");
 
        NULL_CHECK_RET(da_info);
@@ -661,6 +663,7 @@ da_ret_t request_to_cancel_http_download(da_info_t *da_info)
                        if (pthread_cancel(da_info->thread_id) != 0) {
                                DA_LOGE("Fail to cancel thread id[%d]",
                                                da_info->thread_id);
+                               pthread_join(da_info->thread_id, (void **)&status);
                        } else {
                                DA_LOGI("====Exit thread with cancel:da_id[%d]===",
                                                da_info->da_id);
index 9bbe499..417237b 100755 (executable)
@@ -1,7 +1,7 @@
 %define _ux_define tizen2.3
 Name:       download-provider
 Summary:    Download the contents in background
-Version:    2.1.69
+Version:    2.1.70
 Release:    0
 Group:      Development/Libraries
 License:    Apache-2.0