1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-25 01:02:24 +00:00

Get rid of the variable 'advapi' in Pageant's WinMain, which was never

actually used for anything sensible and could have been freed while
containing nonsense at program end.

[originally from svn r9971]
This commit is contained in:
Simon Tatham 2013-07-24 19:18:06 +00:00
parent 6ede5c473a
commit a5fd6ad272

View File

@ -2039,7 +2039,6 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
{
WNDCLASS wndclass;
MSG msg;
HMODULE advapi;
char *command = NULL;
int added_keys = 0;
int argc, i;
@ -2080,8 +2079,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
"Pageant Fatal Error", MB_ICONERROR | MB_OK);
return 1;
#endif
} else
advapi = NULL;
}
/*
* See if we can find our Help file.
@ -2134,8 +2132,6 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
for (i = 0; i < argc; i++) {
if (!strcmp(argv[i], "-pgpfp")) {
pgp_fingerprints();
if (advapi)
FreeLibrary(advapi);
return 1;
} else if (!strcmp(argv[i], "-c")) {
/*
@ -2185,8 +2181,6 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
MessageBox(NULL, "Pageant is already running", "Pageant Error",
MB_ICONERROR | MB_OK);
}
if (advapi)
FreeLibrary(advapi);
return 0;
}
@ -2266,9 +2260,6 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
if (keypath) filereq_free(keypath);
if (advapi)
FreeLibrary(advapi);
cleanup_exit(msg.wParam);
return msg.wParam; /* just in case optimiser complains */
}