diff --git a/common/trans.c b/common/trans.c index 9448760c..5909e4eb 100644 --- a/common/trans.c +++ b/common/trans.c @@ -142,6 +142,24 @@ trans_delete(struct trans *self) g_free(self); } +/*****************************************************************************/ +void +trans_delete_from_child(struct trans *self) +{ + if (self == 0) + { + return; + } + + if (self->listen_filename != 0) + { + g_free(self->listen_filename); + self->listen_filename = 0; + } + + trans_delete(self); +} + /*****************************************************************************/ int trans_get_wait_objs(struct trans *self, tbus *objs, int *count) diff --git a/common/trans.h b/common/trans.h index 57a0fd6a..30559347 100644 --- a/common/trans.h +++ b/common/trans.h @@ -93,6 +93,8 @@ struct trans* trans_create(int mode, int in_size, int out_size); void trans_delete(struct trans* self); +void +trans_delete_from_child(struct trans* self); int trans_get_wait_objs(struct trans* self, tbus* objs, int* count); int diff --git a/xrdp/xrdp_listen.c b/xrdp/xrdp_listen.c index a04768b1..192b0786 100644 --- a/xrdp/xrdp_listen.c +++ b/xrdp/xrdp_listen.c @@ -288,7 +288,7 @@ xrdp_listen_fork(struct xrdp_listen *self, struct trans *server_trans) g_close_wait_obj(self->pro_done_event); xrdp_listen_create_pro_done(self); /* delete listener, child need not listen */ - trans_delete(self->listen_trans); + trans_delete_from_child(self->listen_trans); self->listen_trans = 0; /* new connect instance */ process = xrdp_process_create(self, 0);