1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-09 15:23:50 -05:00

Another big batch of memory leak fixes, again mostly on error paths.

The most interesting one is printer_add_enum, which I've modified to
take a char ** rather than a char * so that it can both realloc its
input buffer _and_ return NULL to indicate error.

[originally from svn r9959]
This commit is contained in:
Simon Tatham
2013-07-22 07:11:54 +00:00
parent 4c61cb20a1
commit b99bec3b02
9 changed files with 107 additions and 42 deletions

View File

@ -410,16 +410,20 @@ static IShellLink *make_shell_link(const char *appname,
/* Check if this is a valid session, otherwise don't add. */
if (sessionname) {
psettings_tmp = open_settings_r(sessionname);
if (!psettings_tmp)
if (!psettings_tmp) {
sfree(app_path);
return NULL;
}
close_settings_r(psettings_tmp);
}
/* Create the new item. */
if (!SUCCEEDED(CoCreateInstance(&CLSID_ShellLink, NULL,
CLSCTX_INPROC_SERVER,
COMPTR(IShellLink, &ret))))
COMPTR(IShellLink, &ret)))) {
sfree(app_path);
return NULL;
}
/* Set path, parameters, icon and description. */
ret->lpVtbl->SetPath(ret, app_path);