Check for null env handle.
authorcantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Fri, 18 Jan 2008 05:04:39 +0000 (05:04 +0000)
committercantor <cantor@cb58f699-b61c-0410-a6fe-9272a202ed29>
Fri, 18 Jan 2008 05:04:39 +0000 (05:04 +0000)
git-svn-id: https://svn.middleware.georgetown.edu/cpp-sp/trunk@2695 cb58f699-b61c-0410-a6fe-9272a202ed29

odbc-store/odbc-store.cpp

index 11405e4..b9086bd 100644 (file)
@@ -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)