[winpr,collections] fix PubSub_OnEvent return checks

* proper return checks on use
* fix return on invalid input arguments
* fix return on no event registered
This commit is contained in:
Armin Novak
2026-03-02 13:17:00 +01:00
parent 32b2bd22aa
commit 17163d3738
16 changed files with 152 additions and 58 deletions

View File

@@ -592,12 +592,14 @@ static UINT rdpgfx_recv_reset_graphics_pdu(GENERIC_CHANNEL_CALLBACK* callback, w
error);
}
free(pdu.monitorDefArray);
/* some listeners may be interested (namely the display channel) */
EventArgsInit(&graphicsReset, "libfreerdp");
graphicsReset.width = pdu.width;
graphicsReset.height = pdu.height;
PubSub_OnGraphicsReset(gfx->rdpcontext->pubSub, gfx->rdpcontext, &graphicsReset);
free(pdu.monitorDefArray);
if (PubSub_OnGraphicsReset(gfx->rdpcontext->pubSub, gfx->rdpcontext, &graphicsReset) < 0)
return ERROR_INTERNAL_ERROR;
return error;
}