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

Improve error handling in registry code

[originally from svn r170]
This commit is contained in:
Simon Tatham 1999-07-05 16:13:31 +00:00
parent 7c9195b8f9
commit cd5c916e25

View File

@ -214,13 +214,16 @@ static void load_settings (char *section, int do_host) {
p = malloc(3*strlen(section)+1); p = malloc(3*strlen(section)+1);
mungestr(section, p); mungestr(section, p);
if (RegOpenKey(HKEY_CURRENT_USER, puttystr, &subkey1) != ERROR_SUCCESS || if (RegOpenKey(HKEY_CURRENT_USER, puttystr, &subkey1) != ERROR_SUCCESS) {
RegOpenKey(subkey1, p, &sesskey) != ERROR_SUCCESS) {
sesskey = NULL; sesskey = NULL;
} else {
if (RegOpenKey(subkey1, p, &sesskey) != ERROR_SUCCESS) {
sesskey = NULL;
}
RegCloseKey(subkey1);
} }
free(p); free(p);
RegCloseKey(subkey1);
if (do_host) { if (do_host) {
char prot[10]; char prot[10];