summaryrefslogtreecommitdiff
path: root/cdr
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2011-09-26 19:40:12 +0000
committerRichard Mudgett <rmudgett@digium.com>2011-09-26 19:40:12 +0000
commit55b70ae6259a85239d5b983424d9d1b6588d8ab7 (patch)
tree2d6350156336b0167284d100cb9872f8b2a1ba21 /cdr
parent6a0fa4e321a8252000f7abec8bc056f223012cf7 (diff)
Merged revisions 337974 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r337974 | rmudgett | 2011-09-26 14:35:23 -0500 (Mon, 26 Sep 2011) | 37 lines Merged revisions 337973 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r337973 | rmudgett | 2011-09-26 14:30:39 -0500 (Mon, 26 Sep 2011) | 30 lines Fix deadlock when using dummy channels. Dummy channels created by ast_dummy_channel_alloc() should be destoyed by ast_channel_unref(). Using ast_channel_release() needlessly grabs the channel container lock and can cause a deadlock as a result. * Analyzed use of ast_dummy_channel_alloc() and made use ast_channel_unref() when done with the dummy channel. (Primary reason for the reported deadlock.) * Made app_dial.c:dial_exec_full() not call ast_call() holding any channel locks. Chan_local could not perform deadlock avoidance correctly. (Potential deadlock exposed by this issue. Secondary reason for the reported deadlock since the held lock was part of the deadlock chain.) * Fixed some uses of ast_dummy_channel_alloc() not checking the returned channel pointer for failure. * Fixed some potential chan=NULL pointer usage in func_odbc.c. Protected by testing the bogus_chan value. * Fixed needlessly clearing a 1024 char auto array when setting the first char to zero is enough in manager.c:action_getvar(). (closes issue ASTERISK-18613) Reported by: Thomas Arimont Patches: jira_asterisk_18613_v1.8.patch (license #5621) patch uploaded by rmudgett Tested by: Thomas Arimont ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337975 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'cdr')
-rw-r--r--cdr/cdr_custom.c3
-rw-r--r--cdr/cdr_manager.c2
-rw-r--r--cdr/cdr_sqlite3_custom.c2
-rw-r--r--cdr/cdr_syslog.c2
4 files changed, 4 insertions, 5 deletions
diff --git a/cdr/cdr_custom.c b/cdr/cdr_custom.c
index 6a2751d1f..ee423d3e6 100644
--- a/cdr/cdr_custom.c
+++ b/cdr/cdr_custom.c
@@ -129,7 +129,6 @@ static int custom_log(struct ast_cdr *cdr)
}
dummy = ast_dummy_channel_alloc();
-
if (!dummy) {
ast_log(LOG_ERROR, "Unable to allocate channel for variable subsitution.\n");
return -1;
@@ -169,7 +168,7 @@ static int custom_log(struct ast_cdr *cdr)
AST_RWLIST_UNLOCK(&sinks);
- ast_channel_release(dummy);
+ ast_channel_unref(dummy);
return 0;
}
diff --git a/cdr/cdr_manager.c b/cdr/cdr_manager.c
index d5106b158..1d9eb6a6a 100644
--- a/cdr/cdr_manager.c
+++ b/cdr/cdr_manager.c
@@ -167,7 +167,7 @@ static int manager_log(struct ast_cdr *cdr)
}
dummy->cdr = ast_cdr_dup(cdr);
pbx_substitute_variables_helper(dummy, ast_str_buffer(customfields), buf, sizeof(buf) - 1);
- ast_channel_release(dummy);
+ ast_channel_unref(dummy);
}
ast_rwlock_unlock(&customfields_lock);
diff --git a/cdr/cdr_sqlite3_custom.c b/cdr/cdr_sqlite3_custom.c
index 97d1a309e..65ef5b8a2 100644
--- a/cdr/cdr_sqlite3_custom.c
+++ b/cdr/cdr_sqlite3_custom.c
@@ -261,7 +261,7 @@ static int write_cdr(struct ast_cdr *cdr)
}
sql = sqlite3_mprintf("INSERT INTO %q (%s) VALUES (%s)", table, columns, ast_str_buffer(value_string));
ast_debug(1, "About to log: %s\n", sql);
- ast_channel_release(dummy);
+ ast_channel_unref(dummy);
ast_free(value_string);
}
diff --git a/cdr/cdr_syslog.c b/cdr/cdr_syslog.c
index b6fc90e0d..adf260594 100644
--- a/cdr/cdr_syslog.c
+++ b/cdr/cdr_syslog.c
@@ -116,7 +116,7 @@ static int syslog_log(struct ast_cdr *cdr)
AST_RWLIST_UNLOCK(&sinks);
- ast_channel_release(dummy);
+ ast_channel_unref(dummy);
return 0;
}