From 51347ef875085957a36477284112dc51b6cbd990 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Mon, 23 Jan 2023 20:00:49 +0100 Subject: [PATCH] Remove unneded string duplication It's unclear why this was initially added. The function takes string constants, so it is not going to modify these. --- common/rfb/WinPasswdValidator.cxx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/common/rfb/WinPasswdValidator.cxx b/common/rfb/WinPasswdValidator.cxx index 18f113cd..84832e81 100644 --- a/common/rfb/WinPasswdValidator.cxx +++ b/common/rfb/WinPasswdValidator.cxx @@ -32,17 +32,10 @@ bool WinPasswdValidator::validateInternal(rfb::SConnection* /*sc*/, const char* username, const char* password) { - char* user = strDup(username); - char* pass = strDup(password); - char* domain = strDup("."); HANDLE handle; - BOOL ret = LogonUser(user, domain, pass, LOGON32_LOGON_NETWORK, + BOOL ret = LogonUser(username, ".", password, LOGON32_LOGON_NETWORK, LOGON32_PROVIDER_DEFAULT, &handle); - delete [] user; - delete [] pass; - delete [] domain; - if (ret != 0) { CloseHandle(handle); return true; -- 2.39.5