Merged revisions 78437 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 7 Aug 2007 19:36:17 +0000 (19:36 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 7 Aug 2007 19:36:17 +0000 (19:36 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r78437 | tilghman | 2007-08-07 14:34:25 -0500 (Tue, 07 Aug 2007) | 2 lines

Don't free the environment handle when the connection fails, because other connections might be depending upon it

........

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

res/res_odbc.c

index 56773f9..c46029f 100644 (file)
@@ -486,10 +486,7 @@ static odbc_status odbc_obj_connect(struct odbc_obj *obj)
        res = SQLAllocHandle(SQL_HANDLE_DBC, obj->parent->env, &obj->con);
 
        if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
        res = SQLAllocHandle(SQL_HANDLE_DBC, obj->parent->env, &obj->con);
 
        if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
-
                ast_log(LOG_WARNING, "res_odbc: Error AllocHDB %d\n", res);
                ast_log(LOG_WARNING, "res_odbc: Error AllocHDB %d\n", res);
-               SQLFreeHandle(SQL_HANDLE_ENV, obj->parent->env);
-
                ast_mutex_unlock(&obj->lock);
                return ODBC_FAIL;
        }
                ast_mutex_unlock(&obj->lock);
                return ODBC_FAIL;
        }