From: Tilghman Lesher Date: Mon, 13 Nov 2006 05:45:11 +0000 (+0000) Subject: If the execute fails a second time, make sure that we don't pass back a stale handle X-Git-Tag: 1.2.14~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a99b6a1c976dfc422670faedb78e24804425a1c7;p=thirdparty%2Fasterisk.git If the execute fails a second time, make sure that we don't pass back a stale handle git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@47525 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_odbc.c b/res/res_odbc.c index cc4b61f2d9..92cd1ccfbb 100644 --- a/res/res_odbc.c +++ b/res/res_odbc.c @@ -140,6 +140,7 @@ SQLHSTMT odbc_prepare_and_execute(odbc_obj *obj, SQLHSTMT (*prepare_cb)(odbc_obj ast_log(LOG_WARNING, "SQL Execute error %d! Attempting a reconnect...\n", res); SQLFreeHandle(SQL_HANDLE_STMT, stmt); + stmt = NULL; ast_mutex_lock(&obj->lock); obj->up = 0;