Merge pull request #3198 from matt335672/add_pointer_guards

Add guards to xrdp_mm_module_cleanup
This commit is contained in:
matt335672 2024-08-26 16:06:38 +01:00 committed by GitHub
commit 8f21f43768
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 3 deletions

View File

@ -131,10 +131,15 @@ xrdp_mm_module_cleanup(struct xrdp_mm *self)
self->mod = 0;
self->mod_handle = 0;
if (self->wm->hide_log_window)
if (self->wm && self->wm->hide_log_window)
{
/* make sure autologin is off.
* Check pointers are valid in case we're ending the process */
if (self->wm->session != NULL &&
self->wm->session->client_info != NULL)
{
/* make sure autologin is off */
self->wm->session->client_info->rdp_autologin = 0;
}
xrdp_wm_set_login_state(self->wm, WMLS_RESET); /* reset session */
}