--- func_odbc.c.orig 2011-03-12 14:08:19.000000000 -0600 +++ func_odbc.c 2011-05-31 18:15:20.000000000 -0500 @@ -790,7 +790,9 @@ struct ast_datastore *store; struct odbc_datastore *resultset; struct odbc_datastore_row *row; + ast_channel_lock(chan); store = ast_channel_datastore_find(chan, &odbc_info, data); + ast_channel_unlock(chan); if (!store) { pbx_builtin_setvar_helper(chan, "ODBC_FETCH_STATUS", "FAILURE"); return -1;