summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorJoshua Colp <jcolp@digium.com>2016-07-14 12:42:17 -0500
committerGerrit Code Review <gerrit2@gerrit.digium.api>2016-07-14 12:42:17 -0500
commit8892029a035d47468c4544742198faa88643ec25 (patch)
tree816248cc10b5a526f110c69a34e34090529b1727 /main
parentb4976b903868788d7615c2a89e02ec6bfc4c395c (diff)
parent672a64bda3142a162f7c458ce7df2896805e9a1f (diff)
Merge "threadpool: Fix leak in ast_threadpool_serializer_group error path." into 13
Diffstat (limited to 'main')
-rw-r--r--main/threadpool.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/main/threadpool.c b/main/threadpool.c
index 9cd33ab1a..6240b7329 100644
--- a/main/threadpool.c
+++ b/main/threadpool.c
@@ -1384,10 +1384,12 @@ struct ast_taskprocessor *ast_threadpool_serializer_group(const char *name,
ao2_ref(ser, -1);
return NULL;
}
- /* ser ref transferred to listener */
tps = ast_taskprocessor_create_with_listener(name, listener);
- if (tps && shutdown_group) {
+ if (!tps) {
+ /* ser ref transferred to listener but not cleaned without tps */
+ ao2_ref(ser, -1);
+ } else if (shutdown_group) {
serializer_shutdown_group_inc(shutdown_group);
}