aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
Diffstat (limited to 'pbx.c')
-rw-r--r--pbx.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pbx.c b/pbx.c
index 5fae072ca..7a8f9979d 100644
--- a/pbx.c
+++ b/pbx.c
@@ -974,8 +974,7 @@ static char *substring(const char *value, int offset, int length, char *workspac
return ret;
}
-/*! \brief pbx_retrieve_variable: Support for Asterisk built-in variables and
- functions in the dialplan
+/*! \brief pbx_retrieve_variable: Support for Asterisk built-in variables
---*/
void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, char *workspace, int workspacelen, struct varshead *headp)
{
@@ -2541,8 +2540,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;
}
@@ -5125,8 +5126,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:
@@ -5228,6 +5231,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 {
ast_log(LOG_ERROR, "Out of memory :(\n");
@@ -5290,11 +5294,13 @@ int ast_pbx_outgoing_app(const char *type, int format, void *data, int timeout,
ast_mutex_unlock(&chan->lock);
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: