From: Christian Grothoff Date: Sun, 6 May 2012 18:15:36 +0000 (+0000) Subject: -fixing #2170 X-Git-Tag: initial-import-from-subversion-38251~13641 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=11b22537ab75960687f9c5cea26314a1ac7aa56b;p=oweals%2Fgnunet.git -fixing #2170 --- 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);