aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/cdr.c11
-rw-r--r--main/channel.c6
-rw-r--r--main/pbx.c1
-rw-r--r--main/poll.c10
4 files changed, 12 insertions, 16 deletions
diff --git a/main/cdr.c b/main/cdr.c
index cabf3fc7a..d66ec767a 100644
--- a/main/cdr.c
+++ b/main/cdr.c
@@ -431,13 +431,6 @@ void ast_cdr_free(struct ast_cdr *cdr)
while (cdr) {
struct ast_cdr *next = cdr->next;
- char *chan = S_OR(cdr->channel, "<unknown>");
- if (!ast_test_flag(cdr, AST_CDR_FLAG_POSTED) && !ast_test_flag(cdr, AST_CDR_FLAG_POST_DISABLED))
- ast_log(LOG_NOTICE, "CDR on channel '%s' not posted\n", chan);
- if (ast_tvzero(cdr->end))
- ast_log(LOG_NOTICE, "CDR on channel '%s' lacks end\n", chan);
- if (ast_tvzero(cdr->start))
- ast_log(LOG_NOTICE, "CDR on channel '%s' lacks start\n", chan);
ast_cdr_free_vars(cdr, 0);
ast_free(cdr);
@@ -1017,10 +1010,6 @@ static void post_cdr(struct ast_cdr *cdr)
chan = S_OR(cdr->channel, "<unknown>");
check_post(cdr);
- if (ast_tvzero(cdr->end))
- ast_log(LOG_WARNING, "CDR on channel '%s' lacks end\n", chan);
- if (ast_tvzero(cdr->start))
- ast_log(LOG_WARNING, "CDR on channel '%s' lacks start\n", chan);
ast_set_flag(cdr, AST_CDR_FLAG_POSTED);
if (ast_test_flag(cdr, AST_CDR_FLAG_POST_DISABLED))
continue;
diff --git a/main/channel.c b/main/channel.c
index fdcdc83d4..6133674cb 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -1345,6 +1345,11 @@ void ast_channel_free(struct ast_channel *chan)
/* Destroy the jitterbuffer */
ast_jb_destroy(chan);
+
+ if (chan->cdr) {
+ ast_cdr_detach(chan->cdr);
+ chan->cdr = NULL;
+ }
ast_mutex_destroy(&chan->lock_dont_use);
@@ -1657,6 +1662,7 @@ int ast_hangup(struct ast_channel *chan)
ast_cdr_end(chan->cdr);
ast_cdr_detach(chan->cdr);
+ chan->cdr = NULL;
}
ast_channel_free(chan);
diff --git a/main/pbx.c b/main/pbx.c
index 8846a9e72..5eb255014 100644
--- a/main/pbx.c
+++ b/main/pbx.c
@@ -6972,6 +6972,7 @@ static int ast_pbx_outgoing_cdr_failed(void)
ast_cdr_end(chan->cdr);
ast_cdr_failed(chan->cdr); /* set the status to failed */
ast_cdr_detach(chan->cdr); /* post and free the record */
+ chan->cdr = NULL;
ast_channel_free(chan); /* free the channel */
return 0; /* success */
diff --git a/main/poll.c b/main/poll.c
index 731dbcefb..823d0cbd4 100644
--- a/main/poll.c
+++ b/main/poll.c
@@ -268,19 +268,19 @@ int poll
fd_set except_descs; /* exception descs */
struct timeval stime; /* select() timeout value */
int ready_descriptors; /* function result */
- int max_fd; /* maximum fd value */
+ int max_fd = 0; /* maximum fd value */
struct timeval *pTimeout; /* actually passed */
FD_ZERO (&read_descs);
FD_ZERO (&write_descs);
FD_ZERO (&except_descs);
- assert(pArray != (struct pollfd *) NULL);
-
/* Map the poll() file descriptor list in the select() data structures. */
- max_fd = map_poll_spec(pArray, n_fds,
- &read_descs, &write_descs, &except_descs);
+ if (pArray) {
+ max_fd = map_poll_spec (pArray, n_fds,
+ &read_descs, &write_descs, &except_descs);
+ }
/* Map the poll() timeout value in the select() timeout structure. */
pTimeout = map_timeout(timeout, &stime);