]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fixes a random crash (NULL reference) in res_odbc.c.
authorDavid Vossel <dvossel@digium.com>
Tue, 3 May 2011 18:49:48 +0000 (18:49 +0000)
committerDavid Vossel <dvossel@digium.com>
Tue, 3 May 2011 18:49:48 +0000 (18:49 +0000)
(closes issue #19180)
Reported by: pruiz
Patches:
      tmp.diff uploaded by pruiz (license 1152)
Tested by: pruiz, seanbright

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

res/res_odbc.c

index 340ee712dcb8d608fb44b6e1aa4efe07f38d4f32..790a18c91c61ee1e1fdfaf5331ad411d83a8553c 100644 (file)
@@ -1360,7 +1360,7 @@ struct odbc_obj *_ast_odbc_request_obj2(const char *name, struct ast_flags flags
 
        if (obj && ast_test_flag(&flags, RES_ODBC_CONNECTED) && !obj->up) {
                /* Check if this connection qualifies for reconnection, with negative connection cache time */
-               if (time(NULL) > class->last_negative_connect.tv_sec + class->negative_connection_cache.tv_sec) {
+               if (time(NULL) > obj->parent->last_negative_connect.tv_sec + obj->parent->negative_connection_cache.tv_sec) {
                        odbc_obj_connect(obj);
                }
        } else if (obj && ast_test_flag(&flags, RES_ODBC_SANITY_CHECK)) {