aboutsummaryrefslogtreecommitdiffstats
path: root/api
diff options
context:
space:
mode:
authorSimon Rozman <simon@rozman.si>2020-10-15 14:57:09 +0200
committerJason A. Donenfeld <Jason@zx2c4.com>2020-10-30 16:51:00 +0100
commit70461121f71c0a94338f555d2ee227cc388bfeb0 (patch)
treeedb3aeadd456a5faa0785d5e2866d64000bc7f24 /api
parentapi: elevate rundll32 calls to SYSTEM (diff)
downloadwintun-70461121f71c0a94338f555d2ee227cc388bfeb0.tar.xz
wintun-70461121f71c0a94338f555d2ee227cc388bfeb0.zip
api: remove temporary folder in case of intermediate failure
Signed-off-by: Simon Rozman <simon@rozman.si>
Diffstat (limited to 'api')
-rw-r--r--api/driver.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/api/driver.c b/api/driver.c
index 1742587..a4d6dc1 100644
--- a/api/driver.c
+++ b/api/driver.c
@@ -320,7 +320,7 @@ InstallDriver(_In_ BOOL UpdateExisting)
!PathCombineW(InfPath, RandomTempSubDirectory, L"wintun.inf"))
{
Result = ERROR_BUFFER_OVERFLOW;
- goto cleanupFree;
+ goto cleanupDirectory;
}
BOOL UseWHQL = HaveWHQL();
@@ -354,6 +354,7 @@ cleanupDelete:
DeleteFileW(CatPath);
DeleteFileW(SysPath);
DeleteFileW(InfPath);
+cleanupDirectory:
RemoveDirectoryW(RandomTempSubDirectory);
cleanupFree:
LocalFree(SecurityAttributes.lpSecurityDescriptor);