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;
|
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);
|
rdp_set_error_info(rdp, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -248,15 +248,19 @@ BOOL rdp_set_error_info(rdpRdp* rdp, UINT32 errorInfo)
|
||||||
|
|
||||||
if (rdp->errorInfo != ERRINFO_SUCCESS)
|
if (rdp->errorInfo != ERRINFO_SUCCESS)
|
||||||
{
|
{
|
||||||
ErrorInfoEventArgs e;
|
rdpContext* context = rdp->context;
|
||||||
rdpContext* context = rdp->instance->context;
|
|
||||||
|
|
||||||
rdp->context->LastError = MAKE_FREERDP_ERROR(ERRINFO, errorInfo);
|
|
||||||
rdp_print_errinfo(rdp->errorInfo);
|
rdp_print_errinfo(rdp->errorInfo);
|
||||||
|
if (context)
|
||||||
EventArgsInit(&e, "freerdp");
|
{
|
||||||
e.code = rdp->errorInfo;
|
context->LastError = MAKE_FREERDP_ERROR(ERRINFO, errorInfo);
|
||||||
PubSub_OnErrorInfo(context->pubSub, context, &e);
|
if (context->pubSub)
|
||||||
|
{
|
||||||
|
ErrorInfoEventArgs e;
|
||||||
|
EventArgsInit(&e, "freerdp");
|
||||||
|
e.code = rdp->errorInfo;
|
||||||
|
PubSub_OnErrorInfo(context->pubSub, context, &e);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue