aboutsummaryrefslogtreecommitdiffstats
path: root/pbx.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-31 21:25:11 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2007-01-31 21:25:11 +0000
commit429708be61aa87849d22506b160268529e333966 (patch)
treec5e1072803ac13065b5b9f0d0e7e352f5cb1acf9 /pbx.c
parent0c01638a1711f8e63655a564971e18db13a904f1 (diff)
Fix a bunch of places where pthread_attr_init() was called, but
pthread_attr_destroy() was not. git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.2@53045 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx.c')
-rw-r--r--pbx.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/pbx.c b/pbx.c
index 5fae072ca..b126c3ddb 100644
--- a/pbx.c
+++ b/pbx.c
@@ -2541,8 +2541,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 +5127,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 +5232,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 +5295,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: