aboutsummaryrefslogtreecommitdiffstats
path: root/cdr
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-02 17:18:48 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-03-02 17:18:48 +0000
commit6628131bf660a242358ddaad96904704241b0d00 (patch)
tree1d030eee7952a08ec3916c3e1fc1939fd82bd304 /cdr
parent2d95f1b34231157dce132c635a607c905e14bfbc (diff)
Backport 1.6.0 fix to trunk (failsafe if db is not loaded)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@179361 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'cdr')
-rw-r--r--cdr/cdr_sqlite3_custom.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/cdr/cdr_sqlite3_custom.c b/cdr/cdr_sqlite3_custom.c
index b79bb50ac..08b675225 100644
--- a/cdr/cdr_sqlite3_custom.c
+++ b/cdr/cdr_sqlite3_custom.c
@@ -240,6 +240,11 @@ static int sqlite3_log(struct ast_cdr *cdr)
struct ast_channel dummy = { 0, };
int count = 0;
+ if (db == NULL) {
+ /* Should not have loaded, but be failsafe. */
+ return 0;
+ }
+
{ /* Make it obvious that only sql should be used outside of this block */
char *escaped;
char subst_buf[2048];