]> source.dussan.org Git - tigervnc.git/commitdiff
Remove unneded string duplication
authorPierre Ossman <ossman@cendio.se>
Mon, 23 Jan 2023 19:00:49 +0000 (20:00 +0100)
committerPierre Ossman <ossman@cendio.se>
Sat, 4 Feb 2023 13:03:13 +0000 (14:03 +0100)
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

index 18f113cdc647b4e6bbe75de9a6e8061a218be7ec..84832e81040fbe58bd5df1c5a9a079e9b9cd30b5 100644 (file)
@@ -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;