mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-20 04:28:07 -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:
parent
56d5dc7eec
commit
f13f9f6420
@ -82,13 +82,14 @@ void *open_settings_w(const char *sessionname, char **errmsg)
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
ret = RegCreateKey(subkey1, p, &sesskey);
|
ret = RegCreateKey(subkey1, p, &sesskey);
|
||||||
sfree(p);
|
|
||||||
RegCloseKey(subkey1);
|
RegCloseKey(subkey1);
|
||||||
if (ret != ERROR_SUCCESS) {
|
if (ret != ERROR_SUCCESS) {
|
||||||
*errmsg = dupprintf("Unable to create registry key\n"
|
*errmsg = dupprintf("Unable to create registry key\n"
|
||||||
"HKEY_CURRENT_USER\\%s\\%s", puttystr, p);
|
"HKEY_CURRENT_USER\\%s\\%s", puttystr, p);
|
||||||
|
sfree(p);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
sfree(p);
|
||||||
return (void *) sesskey;
|
return (void *) sesskey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user