FreeRDP/winpr/libwinpr/sspi/test/TestQuerySecurityPackageInfo.c
Armin Novak 7305828122 Fix #4239: Various memory leaks
* Fixed all tests, now can be run with -DWITH_ADDRESS_SANITIZER=ON compiled.
* Enabled address sanitizer for nightly builds.
2017-12-12 11:40:48 +01:00

29 lines
560 B
C

#include <stdio.h>
#include <winpr/sspi.h>
#include <winpr/winpr.h>
#include <winpr/tchar.h>
int TestQuerySecurityPackageInfo(int argc, char* argv[])
{
int rc;
SECURITY_STATUS status;
SecPkgInfo* pPackageInfo;
sspi_GlobalInit();
status = QuerySecurityPackageInfo(NTLM_SSP_NAME, &pPackageInfo);
if (status != SEC_E_OK)
rc = -1;
else
{
_tprintf(_T("\nQuerySecurityPackageInfo:\n"));
_tprintf(_T("\"%s\", \"%s\"\n"), pPackageInfo->Name, pPackageInfo->Comment);
rc = 0;
}
FreeContextBuffer(pPackageInfo);
sspi_GlobalFinish();
return rc;
}