From 11b22537ab75960687f9c5cea26314a1ac7aa56b Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 6 May 2012 18:15:36 +0000 Subject: [PATCH] -fixing #2170 --- src/transport/plugin_transport_unix.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/transport/plugin_transport_unix.c b/src/transport/plugin_transport_unix.c index a858b9a2d..b81d4d4e1 100644 --- a/src/transport/plugin_transport_unix.c +++ b/src/transport/plugin_transport_unix.c @@ -290,17 +290,16 @@ get_session_delete_it (void *cls, const GNUNET_HashCode * key, void *value) msgw = plugin->msg_head; removed = GNUNET_NO; - while (NULL != (msgw = plugin->msg_head)) + for (msgw = plugin->msg_head; NULL != msgw; msgw = msgw->next) { - if (msgw->session == s) - { - GNUNET_CONTAINER_DLL_remove (plugin->msg_head, plugin->msg_tail, msgw); - if (msgw->cont != NULL) - msgw->cont (msgw->cont_cls, &msgw->session->target, GNUNET_SYSERR); - GNUNET_free (msgw->msg); - GNUNET_free (msgw); - removed = GNUNET_YES; - } + if (msgw->session != s) + continue; + GNUNET_CONTAINER_DLL_remove (plugin->msg_head, plugin->msg_tail, msgw); + if (NULL != msgw->cont) + msgw->cont (msgw->cont_cls, &msgw->session->target, GNUNET_SYSERR); + GNUNET_free (msgw->msg); + GNUNET_free (msgw); + removed = GNUNET_YES; } if ((GNUNET_YES == removed) && (NULL == plugin->msg_head)) reschedule_select (plugin); -- 2.25.1