Revert "Don't delete packet stream"
[silc.git] / lib / silccore / silcpacket.c
index 2f491acb5f0997f2e5c30455be8a9eb638954eb9..f552ca6d1741aebf31648e1c694d34c302792ac3 100644 (file)
@@ -1108,21 +1108,19 @@ void silc_packet_stream_unlink(SilcPacketStream stream,
 
   silc_mutex_lock(stream->lock);
 
-  if (stream->process) {
-    silc_dlist_start(stream->process);
-    while ((p = silc_dlist_get(stream->process)) != SILC_LIST_END)
-      if (p->callbacks == callbacks &&
-         p->callback_context == callback_context) {
-        silc_dlist_del(stream->process, p);
-        silc_free(p->types);
-        silc_free(p);
-        break;
-      }
-
-    if (!silc_dlist_count(stream->process)) {
-      silc_dlist_uninit(stream->process);
-      stream->process = NULL;
+  silc_dlist_start(stream->process);
+  while ((p = silc_dlist_get(stream->process)) != SILC_LIST_END)
+    if (p->callbacks == callbacks &&
+       p->callback_context == callback_context) {
+      silc_dlist_del(stream->process, p);
+      silc_free(p->types);
+      silc_free(p);
+      break;
     }
+
+  if (!silc_dlist_count(stream->process)) {
+    silc_dlist_uninit(stream->process);
+    stream->process = NULL;
   }
 
   silc_mutex_unlock(stream->lock);