mirror of https://github.com/FreeRDP/FreeRDP
freerdp: Fix possible crash when setting error info in server-mode
This commit is contained in:
parent
05bcec47b8
commit
b2d24a4dd2
|
@ -627,7 +627,11 @@ UINT32 freerdp_error_info(freerdp* instance)
|
|||
return instance->context->rdp->errorInfo;
|
||||
}
|
||||
|
||||
void freerdp_set_error_info(rdpRdp* rdp, UINT32 error) {
|
||||
void freerdp_set_error_info(rdpRdp* rdp, UINT32 error)
|
||||
{
|
||||
if (!rdp)
|
||||
return;
|
||||
|
||||
rdp_set_error_info(rdp, error);
|
||||
}
|
||||
|
||||
|
|
|
@ -248,15 +248,19 @@ BOOL rdp_set_error_info(rdpRdp* rdp, UINT32 errorInfo)
|
|||
|
||||
if (rdp->errorInfo != ERRINFO_SUCCESS)
|
||||
{
|
||||
ErrorInfoEventArgs e;
|
||||
rdpContext* context = rdp->instance->context;
|
||||
|
||||
rdp->context->LastError = MAKE_FREERDP_ERROR(ERRINFO, errorInfo);
|
||||
rdpContext* context = rdp->context;
|
||||
rdp_print_errinfo(rdp->errorInfo);
|
||||
|
||||
EventArgsInit(&e, "freerdp");
|
||||
e.code = rdp->errorInfo;
|
||||
PubSub_OnErrorInfo(context->pubSub, context, &e);
|
||||
if (context)
|
||||
{
|
||||
context->LastError = MAKE_FREERDP_ERROR(ERRINFO, errorInfo);
|
||||
if (context->pubSub)
|
||||
{
|
||||
ErrorInfoEventArgs e;
|
||||
EventArgsInit(&e, "freerdp");
|
||||
e.code = rdp->errorInfo;
|
||||
PubSub_OnErrorInfo(context->pubSub, context, &e);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue