diff options
Diffstat (limited to 'src/daemon/dlt_daemon_event_handler.c')
-rw-r--r-- | src/daemon/dlt_daemon_event_handler.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/daemon/dlt_daemon_event_handler.c b/src/daemon/dlt_daemon_event_handler.c index 895a896..38aa022 100644 --- a/src/daemon/dlt_daemon_event_handler.c +++ b/src/daemon/dlt_daemon_event_handler.c @@ -285,14 +285,15 @@ int dlt_daemon_handle_event(DltEventHandler *pEvent, * * @return The found connection pointer, NULL otherwise. */ -DltConnection *dlt_event_handler_find_connection(DltEventHandler *ev, - int fd) +DltConnection *dlt_event_handler_find_connection(DltEventHandler *ev, int fd) { - DltConnection *temp = ev->connections; - while ((temp != NULL) && (temp->receiver->fd != fd)) + while (temp != NULL) { + if ((temp->receiver != NULL) && (temp->receiver->fd == fd)) + return temp; temp = temp->next; + } return temp; } |