]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fix heap corruption when calling ub_ctx_delete in Windows (#1157)
authorLiang Zhu <lnzhu@users.noreply.github.com>
Fri, 1 Nov 2024 15:26:05 +0000 (08:26 -0700)
committerGitHub <noreply@github.com>
Fri, 1 Nov 2024 15:26:05 +0000 (16:26 +0100)
util/tube.c

index 7d98b93c37517808e4e4ca62938f8d224206ce54..96187e134e2ff3acde5373ba247e16cf42bf11e3 100644 (file)
@@ -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)