From 99958e5c6ca14ed6290365a5e58347d82300c24a Mon Sep 17 00:00:00 2001 From: cantor Date: Fri, 18 Jan 2008 05:04:39 +0000 Subject: [PATCH] Check for null env handle. git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2695 cb58f699-b61c-0410-a6fe-9272a202ed29 --- odbc-store/odbc-store.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/odbc-store/odbc-store.cpp b/odbc-store/odbc-store.cpp index 11405e4..b9086bd 100644 --- a/odbc-store/odbc-store.cpp +++ b/odbc-store/odbc-store.cpp @@ -314,7 +314,8 @@ ODBCStorageService::~ODBCStorageService() shutdown_wait->signal(); cleanup_thread->join(NULL); delete shutdown_wait; - SQLFreeHandle(SQL_HANDLE_ENV, m_henv); + if (m_henv != SQL_NULL_HANDLE) + SQLFreeHandle(SQL_HANDLE_ENV, m_henv); } bool ODBCStorageService::log_error(SQLHANDLE handle, SQLSMALLINT htype, const char* checkfor) -- 2.1.4