diff options
Diffstat (limited to 'main')
-rw-r--r-- | main/cdr.c | 1 | ||||
-rw-r--r-- | main/http.c | 2 | ||||
-rw-r--r-- | main/manager.c | 1 | ||||
-rw-r--r-- | main/pbx.c | 7 |
4 files changed, 11 insertions, 0 deletions
diff --git a/main/cdr.c b/main/cdr.c index e8eebe10f..33f326b86 100644 --- a/main/cdr.c +++ b/main/cdr.c @@ -861,6 +861,7 @@ void ast_cdr_submit_batch(int shutdown) if (option_debug) ast_log(LOG_DEBUG, "CDR multi-threaded batch processing begins now\n"); } + pthread_attr_destroy(&attr); } } diff --git a/main/http.c b/main/http.c index 30c4e930e..3d0b7f703 100644 --- a/main/http.c +++ b/main/http.c @@ -684,6 +684,8 @@ void *server_root(void *data) close(ser->fd); free(ser); } + + pthread_attr_destroy(&attr); } return NULL; } diff --git a/main/manager.c b/main/manager.c index b84cd9ba5..4a63b6764 100644 --- a/main/manager.c +++ b/main/manager.c @@ -1841,6 +1841,7 @@ static int action_originate(struct mansession *s, const struct message *m) } else { res = 0; } + pthread_attr_destroy(&attr); } } else if (!ast_strlen_zero(app)) { res = ast_pbx_outgoing_app(tech, AST_FORMAT_SLINEAR, data, to, app, appdata, &reason, 1, l, n, vars, account, NULL); diff --git a/main/pbx.c b/main/pbx.c index a3a0ebe37..f60b2b2bd 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -2506,8 +2506,10 @@ enum ast_pbx_result ast_pbx_start(struct ast_channel *c) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); if (ast_pthread_create(&t, &attr, pbx_thread, c)) { ast_log(LOG_WARNING, "Failed to create new channel thread\n"); + pthread_attr_destroy(&attr); return AST_PBX_FAILED; } + pthread_attr_destroy(&attr); return AST_PBX_SUCCESS; } @@ -5015,8 +5017,10 @@ int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout } ast_hangup(chan); res = -1; + pthread_attr_destroy(&attr); goto outgoing_exten_cleanup; } + pthread_attr_destroy(&attr); res = 0; } outgoing_exten_cleanup: @@ -5118,6 +5122,7 @@ int ast_pbx_outgoing_app(const char *type, int format, void *data, int timeout, if (locked_channel) *locked_channel = chan; } + pthread_attr_destroy(&attr); } } } else { @@ -5176,11 +5181,13 @@ int ast_pbx_outgoing_app(const char *type, int format, void *data, int timeout, ast_channel_unlock(chan); ast_hangup(chan); res = -1; + pthread_attr_destroy(&attr); goto outgoing_app_cleanup; } else { if (locked_channel) *locked_channel = chan; } + pthread_attr_destroy(&attr); res = 0; } outgoing_app_cleanup: |