mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02:24 +00:00
Unix: fix segfault if ~/.putty/sessions doesn't exist.
Looks as if I introduced this in commit 733fcca2c
, where the pointer
returned from enum_settings_start() stopped being the same thing as
the underlying 'DIR *' - I needed to retain a check for the outer
containing structure not being NULL but the DIR * being NULL inside
it.
This commit is contained in:
parent
34df99907a
commit
9072bab11b
@ -562,6 +562,9 @@ char *enum_settings_next(settings_e *handle, char *buffer, int buflen)
|
||||
int maxlen, thislen, len;
|
||||
char *unmunged;
|
||||
|
||||
if (!handle->dp)
|
||||
return NULL;
|
||||
|
||||
fullpath = make_filename(INDEX_SESSIONDIR, NULL);
|
||||
maxlen = len = strlen(fullpath);
|
||||
|
||||
@ -592,7 +595,8 @@ char *enum_settings_next(settings_e *handle, char *buffer, int buflen)
|
||||
|
||||
void enum_settings_finish(settings_e *handle)
|
||||
{
|
||||
closedir(handle->dp);
|
||||
if (handle->dp)
|
||||
closedir(handle->dp);
|
||||
sfree(handle);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user