summaryrefslogtreecommitdiff
path: root/cel
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 /cel
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 'cel')
-rw-r--r--cel/cel_custom.c3
-rw-r--r--cel/cel_sqlite3_custom.c2
2 files changed, 2 insertions, 3 deletions
diff --git a/cel/cel_custom.c b/cel/cel_custom.c
index 54b1e4f5e..871408716 100644
--- a/cel/cel_custom.c
+++ b/cel/cel_custom.c
@@ -128,7 +128,6 @@ static void custom_log(const struct ast_event *event, void *userdata)
}
dummy = ast_cel_fabricate_channel_from_event(event);
-
if (!dummy) {
ast_log(LOG_ERROR, "Unable to fabricate channel from CEL event.\n");
return;
@@ -163,7 +162,7 @@ static void custom_log(const struct ast_event *event, void *userdata)
AST_RWLIST_UNLOCK(&sinks);
- ast_channel_release(dummy);
+ ast_channel_unref(dummy);
}
static int unload_module(void)
diff --git a/cel/cel_sqlite3_custom.c b/cel/cel_sqlite3_custom.c
index 2906ed9ee..4596e770e 100644
--- a/cel/cel_sqlite3_custom.c
+++ b/cel/cel_sqlite3_custom.c
@@ -262,7 +262,7 @@ static void write_cel(const struct ast_event *event, void *userdata)
}
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);
- dummy = ast_channel_release(dummy);
+ dummy = ast_channel_unref(dummy);
ast_free(value_string);
}