]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Merged revisions 179361 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Mon, 2 Mar 2009 17:19:41 +0000 (17:19 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Mon, 2 Mar 2009 17:19:41 +0000 (17:19 +0000)
https://origsvn.digium.com/svn/asterisk/trunk

........
  r179361 | tilghman | 2009-03-02 11:18:48 -0600 (Mon, 02 Mar 2009) | 2 lines

  Backport 1.6.0 fix to trunk (failsafe if db is not loaded)
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@179362 65c4cc65-6c06-0410-ace0-fbb531ad65f3

cdr/cdr_sqlite3_custom.c

index 6c9a431bd76f19e90a1cb87cf1ac6a4ae000b2a4..fc4741d410b4ed309a074f78b0d10ae2351fa0e5 100644 (file)
@@ -246,6 +246,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];