From 6276f3d39abfab6da46414dd8f9cd89e068d141c Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Thu, 27 Oct 2016 14:36:48 +0200 Subject: [PATCH] Added log messages for invalid function call. --- libfreerdp/core/freerdp.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libfreerdp/core/freerdp.c b/libfreerdp/core/freerdp.c index 35dcae1..7f1ba17 100644 --- a/libfreerdp/core/freerdp.c +++ b/libfreerdp/core/freerdp.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -63,7 +64,12 @@ void freerdp_channel_init_thread_context(rdpContext* context) freerdp* freerdp_channel_get_instance(void) { if (!s_TLSContext) + { + WLog_ERR(TAG, + "Funcion was called from thread that did not call freerdp_channel_init_thread_context"); + winpr_log_backtrace(TAG, WLOG_ERROR, 20); return NULL; + } return s_TLSContext->instance; } @@ -76,7 +82,12 @@ rdpContext* freerdp_channel_get_context(void) rdpChannels* freerdp_channel_get_channels_context(void) { if (!s_TLSContext) + { + WLog_ERR(TAG, + "Funcion was called from thread that did not call freerdp_channel_init_thread_context"); + winpr_log_backtrace(TAG, WLOG_ERROR, 20); return NULL; + } return s_TLSContext->channels; } -- 2.7.4