1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-09 23:28:06 -05:00

Fix potential access of freed data (only if we couldn't create the

second of two registry keys, so pretty unlikely).

[originally from svn r5021]
This commit is contained in:
Jacob Nevins 2004-12-22 23:17:02 +00:00
parent 56d5dc7eec
commit f13f9f6420

View File

@ -82,13 +82,14 @@ void *open_settings_w(const char *sessionname, char **errmsg)
return NULL;
}
ret = RegCreateKey(subkey1, p, &sesskey);
sfree(p);
RegCloseKey(subkey1);
if (ret != ERROR_SUCCESS) {
*errmsg = dupprintf("Unable to create registry key\n"
"HKEY_CURRENT_USER\\%s\\%s", puttystr, p);
sfree(p);
return NULL;
}
sfree(p);
return (void *) sesskey;
}