1
0
Fork 0
mirror of https://github.com/Atmosphere-NX/Atmosphere.git synced 2024-11-09 21:51:45 +00:00

sm: fix abort on RegisterService while at port limit

closes #1382
This commit is contained in:
Michael Scire 2021-02-23 14:21:36 -08:00
parent cbf3ba9b75
commit 287f4e6fa1

View file

@ -409,13 +409,15 @@ namespace ams::sm::impl {
/* Create the new service. */
*out = INVALID_HANDLE;
R_TRY(svcCreatePort(out, free_service->port_h.GetPointerAndClear(), max_sessions, is_light, free_service->name.name));
Handle server_hnd = INVALID_HANDLE;
R_TRY(svcCreatePort(out, std::addressof(server_hnd), max_sessions, is_light, free_service->name.name));
/* Save info. */
free_service->name = service;
free_service->owner_process_id = process_id;
free_service->max_sessions = max_sessions;
free_service->is_light = is_light;
*free_service->port_h.GetPointerAndClear() = server_hnd;
/* This might undefer some requests. */
TriggerResume(service);