freetdm: fix asserts

This commit is contained in:
Moises Silva 2010-08-31 14:42:41 -04:00
parent 6c9e6be255
commit 6216d5df07
1 changed files with 5 additions and 6 deletions

View File

@ -2122,7 +2122,8 @@ FT_DECLARE(ftdm_status_t) _ftdm_channel_call_place(const char *file, const char
{
ftdm_status_t status = FTDM_FAIL;
ftdm_assert(ftdmchan != NULL, "null channel");
ftdm_assert_return(ftdmchan != NULL, FTDM_FAIL, "null channel");
ftdm_assert_return(ftdm_test_flag(ftdmchan, FTDM_CHANNEL_OUTBOUND), FTDM_FAIL, "Call place, but outbound flag not set\n");
ftdm_channel_lock(ftdmchan);
@ -2268,14 +2269,12 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_close(ftdm_channel_t **ftdmchan)
ftdm_channel_t *check;
ftdm_status_t status = FTDM_FAIL;
assert(ftdmchan != NULL);
ftdm_assert_return(ftdmchan != NULL, FTDM_FAIL, "null channel double pointer provided!\n");
ftdm_assert_return(*ftdmchan != NULL, FTDM_FAIL, "null channel pointer provided!\n");
check = *ftdmchan;
*ftdmchan = NULL;
if (!check) {
return FTDM_FAIL;
}
if (ftdm_test_flag(check, FTDM_CHANNEL_CONFIGURED)) {
ftdm_mutex_lock(check->mutex);
if (ftdm_test_flag(check, FTDM_CHANNEL_OPEN)) {