зеркало из https://github.com/github/putty.git
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:
Родитель
56d5dc7eec
Коммит
f13f9f6420
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче