Kaydet (Commit) 58008a0f authored tarafından Mike Kaganski's avatar Mike Kaganski

Cppcheck: resource leak warning

Change-Id: I855097279cd091c1e8bd665bb0b48ce9279a9ca8
Reviewed-on: https://gerrit.libreoffice.org/60121Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 5dd1474c
......@@ -11,6 +11,10 @@ $(eval $(call gb_Executable_Executable,odbcconfig))
$(eval $(call gb_Executable_set_targettype_gui,odbcconfig,YES))
$(eval $(call gb_Executable_use_libraries,odbcconfig,\
comphelper \
))
$(eval $(call gb_Library_use_sdk_api,odbcconfig))
$(eval $(call gb_Executable_add_exception_objects,odbcconfig,\
......
......@@ -23,6 +23,7 @@
#endif
#include <windows.h>
#include <sqlext.h>
#include <comphelper/scopeguard.hxx>
// the name of the library which contains the SQLManageDataSources function
#define ODBC_UI_LIB_NAME L"ODBCCP32.DLL"
......@@ -113,6 +114,7 @@ extern "C" int APIENTRY wWinMain( HINSTANCE _hAppInstance, HINSTANCE, LPWSTR, in
hModule = LoadLibraryExW( ODBC_UI_LIB_NAME, nullptr, LOAD_WITH_ALTERED_SEARCH_PATH );
if ( hModule == nullptr )
return displayLastError();
comphelper::ScopeGuard hModuleReleaser([hModule]() { FreeLibrary(hModule); });
FARPROC pManageDSProc = GetProcAddress( hModule, "SQLManageDataSources" );
if ( pManageDSProc == nullptr )
......@@ -122,8 +124,6 @@ extern "C" int APIENTRY wWinMain( HINSTANCE _hAppInstance, HINSTANCE, LPWSTR, in
if ( !( (*pManageDS)( hAppWindow ) ) )
return displayLastError();
FreeLibrary( hModule );
return 0;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment