From: Liang Zhu Date: Fri, 1 Nov 2024 15:26:05 +0000 (-0700) Subject: Fix heap corruption when calling ub_ctx_delete in Windows (#1157) X-Git-Tag: release-1.23.0rc1~108 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=1c24cd79cccc55db6424aca348a288ba25b1bf21;p=thirdparty%2Funbound.git Fix heap corruption when calling ub_ctx_delete in Windows (#1157) --- diff --git a/util/tube.c b/util/tube.c index 7d98b93c3..96187e134 100644 --- a/util/tube.c +++ b/util/tube.c @@ -584,7 +584,10 @@ void tube_close_write(struct tube* ATTR_UNUSED(tube)) void tube_remove_bg_listen(struct tube* tube) { verbose(VERB_ALGO, "tube remove_bg_listen"); - ub_winsock_unregister_wsaevent(tube->ev_listen); + if (tube->ev_listen != NULL) { + ub_winsock_unregister_wsaevent(tube->ev_listen); + tube->ev_listen = NULL; + } } void tube_remove_bg_write(struct tube* tube)