PROTON-1844: Windows proactor memory corruption fix (from epoll fix PROTON-1773)


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/cd2783fa
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/cd2783fa
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/cd2783fa

Branch: refs/heads/go1
Commit: cd2783fae628cec6b789bf03c5b173ad933d50f1
Parents: 8e65759
Author: Clifford Jansen <cliffjan...@apache.org>
Authored: Sat May 12 17:53:33 2018 -0700
Committer: Clifford Jansen <cliffjan...@apache.org>
Committed: Sat May 12 17:53:33 2018 -0700

----------------------------------------------------------------------
 c/src/proactor/win_iocp.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/cd2783fa/c/src/proactor/win_iocp.c
----------------------------------------------------------------------
diff --git a/c/src/proactor/win_iocp.c b/c/src/proactor/win_iocp.c
index e41ac5b..59194c6 100644
--- a/c/src/proactor/win_iocp.c
+++ b/c/src/proactor/win_iocp.c
@@ -3350,7 +3350,10 @@ void pn_proactor_disconnect(pn_proactor_t *p, 
pn_condition_t *cond) {
   }
 
   // Second pass: different locking, close the pcontexts, free them if 
!disconnect_ops
-  for (ctx = disconnecting_pcontexts; ctx; ctx = ctx ? ctx->next : NULL) {
+  pcontext_t *next = disconnecting_pcontexts;
+  while (next) {
+    ctx = next;
+    next = ctx->next;           /* Save next pointer in case we free ctx */
     bool do_free = false;
     pconnection_t *pc = pcontext_pconnection(ctx);
     pn_listener_t *l = pc ? NULL : pcontext_listener(ctx);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org
For additional commands, e-mail: commits-h...@qpid.apache.org

Reply via email to