summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xvmeta_lib.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/vmeta_lib.c b/vmeta_lib.c
index b7a8c5f..a72951c 100755
--- a/vmeta_lib.c
+++ b/vmeta_lib.c
@@ -832,6 +832,8 @@ int vmeta_thread_monitor(struct monitor_data * pmd)
if(p_cb->kernel_share_va==0 || pmd == NULL)
{
dbg_printf(VDEC_DEBUG_ALL,"vdec_os_api_free_user_id error: not init yet\n");
+ free(pmd);
+ pthread_detach(pthread_self());
pthread_mutex_unlock(&pmt);
return -1;
}
@@ -839,6 +841,8 @@ int vmeta_thread_monitor(struct monitor_data * pmd)
p_md = malloc(sizeof(struct monitor_data));
if(p_md == NULL)
{
+ free(pmd);
+ pthread_detach(pthread_self());
pthread_mutex_unlock(&pmt);
return -1;
}
@@ -900,6 +904,7 @@ int vmeta_thread_monitor(struct monitor_data * pmd)
pthread_attr_destroy(&pat);
dbg_printf(VDEC_DEBUG_MEM,"thread monitor exit\n");
+ pthread_detach(pthread_self());
pthread_mutex_unlock(&pmt);
return 0;
@@ -907,6 +912,7 @@ tag_monitor_fail:
pthread_mutex_unlock(&pmt);
free(p_md);
free(pmd);
+ pthread_detach(pthread_self());
pthread_attr_destroy(&pat);
return -1;