From: Christian Grothoff Date: Sun, 24 Jun 2012 07:31:11 +0000 (+0000) Subject: -LRN: Don't free shutdown handle while it's in use X-Git-Tag: initial-import-from-subversion-38251~12850 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;ds=sidebyside;h=6646a17fc129acf1c2d397492f2ca9cda4b4b8b4;p=oweals%2Fgnunet.git -LRN: Don't free shutdown handle while it's in use --- diff --git a/src/stream/stream_api.c b/src/stream/stream_api.c index 18435d0a7..df0710e80 100644 --- a/src/stream/stream_api.c +++ b/src/stream/stream_api.c @@ -1741,8 +1741,6 @@ handle_generic_close_ack (struct GNUNET_STREAM_Socket *socket, if (NULL != shutdown_handle->completion_cb) /* Shutdown completion */ shutdown_handle->completion_cb(shutdown_handle->completion_cls, operation); - GNUNET_free (shutdown_handle); /* Free shutdown handle */ - socket->shutdown_handle = NULL; if (GNUNET_SCHEDULER_NO_TASK != shutdown_handle->close_msg_retransmission_task_id) { @@ -1751,6 +1749,8 @@ handle_generic_close_ack (struct GNUNET_STREAM_Socket *socket, shutdown_handle->close_msg_retransmission_task_id = GNUNET_SCHEDULER_NO_TASK; } + GNUNET_free (shutdown_handle); /* Free shutdown handle */ + socket->shutdown_handle = NULL; return GNUNET_OK; }