VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Common
diff options
context:
space:
mode:
Diffstat (limited to 'src/Common')
-rw-r--r--src/Common/Dlgcode.c16
-rw-r--r--src/Common/Dlgcode.h1
2 files changed, 4 insertions, 13 deletions
diff --git a/src/Common/Dlgcode.c b/src/Common/Dlgcode.c
index 8b1db616..ee3630c0 100644
--- a/src/Common/Dlgcode.c
+++ b/src/Common/Dlgcode.c
@@ -15828,7 +15828,6 @@ BOOL EnableRequiredSetupPrivileges(PPRIVILEGE_STATE currentState)
BOOL BackupSecurityInfo(const wchar_t* filePath, PSECURITY_INFO_BACKUP pBackup)
{
BOOL result = FALSE;
- PSECURITY_DESCRIPTOR pSD = NULL;
DWORD dwRes;
ZeroMemory(pBackup, sizeof(SECURITY_INFO_BACKUP));
@@ -15843,7 +15842,7 @@ BOOL BackupSecurityInfo(const wchar_t* filePath, PSECURITY_INFO_BACKUP pBackup)
&pBackup->pOrigGroup,
&pBackup->pOrigDacl,
&pBackup->pOrigSacl,
- &pSD);
+ &pBackup->pOrigSD);
if (dwRes == ERROR_SUCCESS)
{
@@ -15852,9 +15851,6 @@ BOOL BackupSecurityInfo(const wchar_t* filePath, PSECURITY_INFO_BACKUP pBackup)
result = TRUE;
}
- if (pSD)
- LocalFree(pSD);
-
return result;
}
@@ -15891,14 +15887,8 @@ BOOL RestoreSecurityInfo(const wchar_t* filePath, PSECURITY_INFO_BACKUP pBackup)
// Helper function to free security backup
void FreeSecurityBackup(PSECURITY_INFO_BACKUP pBackup)
{
- if (pBackup->pOrigOwner)
- LocalFree(pBackup->pOrigOwner);
- if (pBackup->pOrigGroup)
- LocalFree(pBackup->pOrigGroup);
- if (pBackup->pOrigDacl)
- LocalFree(pBackup->pOrigDacl);
- if (pBackup->pOrigSacl)
- LocalFree(pBackup->pOrigSacl);
+ if (pBackup->pOrigSD)
+ LocalFree(pBackup->pOrigSD);
ZeroMemory(pBackup, sizeof(SECURITY_INFO_BACKUP));
}
diff --git a/src/Common/Dlgcode.h b/src/Common/Dlgcode.h
index 2bc95ae9..4dfae20f 100644
--- a/src/Common/Dlgcode.h
+++ b/src/Common/Dlgcode.h
@@ -604,6 +604,7 @@ typedef struct _SECURITY_INFO_BACKUP {
PSID pOrigGroup;
PACL pOrigDacl;
PACL pOrigSacl;
+ PSECURITY_DESCRIPTOR pOrigSD;
} SECURITY_INFO_BACKUP, * PSECURITY_INFO_BACKUP;
typedef struct _PRIVILEGE_STATE {