summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/os_calls.c5
-rw-r--r--xrdp/xrdp_listen.c5
-rw-r--r--xrdp/xrdp_orders.c4
3 files changed, 11 insertions, 3 deletions
diff --git a/common/os_calls.c b/common/os_calls.c
index e236088c..095ff4fd 100644
--- a/common/os_calls.c
+++ b/common/os_calls.c
@@ -590,8 +590,11 @@ int g_thread_create(unsigned long (__stdcall * start_routine)(void*), void* arg)
int g_thread_create(void* (* start_routine)(void*), void* arg)
{
pthread_t thread;
+ int rv;
- return pthread_create(&thread, 0, start_routine, arg);
+ rv = pthread_create(&thread, 0, start_routine, arg);
+ pthread_detach(thread);
+ return rv;
}
#endif
diff --git a/xrdp/xrdp_listen.c b/xrdp/xrdp_listen.c
index 92de0b99..6b965ecd 100644
--- a/xrdp/xrdp_listen.c
+++ b/xrdp/xrdp_listen.c
@@ -139,7 +139,8 @@ int xrdp_listen_main_loop(struct xrdp_listen* self)
self->status = 1;
self->sck = g_tcp_socket();
g_tcp_set_non_blocking(self->sck);
- if (g_tcp_bind(self->sck, "3389") != 0)
+ error = g_tcp_bind(self->sck, "3389");
+ if (error != 0)
{
g_printf("bind error in xrdp_listen_main_loop\n\r");
g_tcp_close(self->sck);
@@ -178,7 +179,7 @@ int xrdp_listen_main_loop(struct xrdp_listen* self)
}
else
{
- DEBUG(("error, listener done\n\r"));
+ DEBUG(("listen error in xrdp_listen_main_loop\n\r"));
}
xrdp_listen_term_processes(self);
g_tcp_close(self->sck);
diff --git a/xrdp/xrdp_orders.c b/xrdp/xrdp_orders.c
index 688c211f..7b5e1273 100644
--- a/xrdp/xrdp_orders.c
+++ b/xrdp/xrdp_orders.c
@@ -39,6 +39,10 @@ struct xrdp_orders* xrdp_orders_create(struct xrdp_process* owner,
/*****************************************************************************/
void xrdp_orders_delete(struct xrdp_orders* self)
{
+ if (self == 0)
+ {
+ return;
+ }
free_stream(self->out_s);
g_free(self);
}