diff --git a/client/DirectFB/dfreerdp.c b/client/DirectFB/dfreerdp.c index 5c11b769d..2175a6473 100644 --- a/client/DirectFB/dfreerdp.c +++ b/client/DirectFB/dfreerdp.c @@ -265,7 +265,8 @@ int dfreerdp_run(freerdp* instance) memset(rfds, 0, sizeof(rfds)); memset(wfds, 0, sizeof(wfds)); - instance->Connect(instance); + if (!instance->Connect(instance)) + return 0; dfi = GET_DFI(instance); chanman = GET_CHANMAN(instance); diff --git a/client/X11/xfreerdp.c b/client/X11/xfreerdp.c index 5379db4a1..9d5506474 100644 --- a/client/X11/xfreerdp.c +++ b/client/X11/xfreerdp.c @@ -489,7 +489,8 @@ int xfreerdp_run(freerdp* instance) memset(rfds, 0, sizeof(rfds)); memset(wfds, 0, sizeof(wfds)); - instance->Connect(instance); + if (!instance->Connect(instance)) + return 0; xfi = GET_XFI(instance); chanman = GET_CHANMAN(instance); diff --git a/libfreerdp-core/freerdp.c b/libfreerdp-core/freerdp.c index 10ece64ae..2f9bc7cb6 100644 --- a/libfreerdp-core/freerdp.c +++ b/libfreerdp-core/freerdp.c @@ -35,7 +35,8 @@ boolean freerdp_connect(freerdp* instance) IFCALL(instance->PreConnect, instance); status = rdp_client_connect((rdpRdp*) instance->rdp); - IFCALL(instance->PostConnect, instance); + if (status) + IFCALL(instance->PostConnect, instance); return status; }