]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
In cel_odbc, an uninitialized RWLIST is attempted to be locked.
authorMark Murawki <markm@intellasoft.net>
Thu, 19 May 2011 17:59:01 +0000 (17:59 +0000)
committerMark Murawki <markm@intellasoft.net>
Thu, 19 May 2011 17:59:01 +0000 (17:59 +0000)
Added INIT and DESTROY for the RWLIST odbc_tables

(closes issue #19331)
Reported by: kobaz
Patches:
      odbc_cel.patch uploaded by kobaz (license 834)

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

cel/cel_odbc.c

index cf970690b5d05dbfdd125a023561167040c4e72d..d298f1ba2f99b864fe888a5056a3e2fa6bb48e14 100644 (file)
@@ -751,11 +751,15 @@ static int unload_module(void)
 
        free_config();
        AST_RWLIST_UNLOCK(&odbc_tables);
+       AST_RWLIST_HEAD_DESTROY(&odbc_tables);
+        
        return 0;
 }
 
 static int load_module(void)
 {
+       AST_RWLIST_HEAD_INIT(&odbc_tables);
+
        if (AST_RWLIST_WRLOCK(&odbc_tables)) {
                ast_log(LOG_ERROR, "Unable to lock column list.  Load failed.\n");
                return 0;