yaid.c (cancel_proxy): Reorder destruction a little.
authorMark Wooding <mdw@distorted.org.uk>
Mon, 22 Dec 2014 20:32:58 +0000 (20:32 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sun, 18 Jan 2015 16:34:54 +0000 (16:34 +0000)
Alas, `selbuf_enable' can invoke its per-line function, in this case
`client_line', immediately.  So we need to make sure we've detached this
proxy structure before that happens: if we do it afterwards, we risk
clobbering any new proxy that `client_line' has acquired in the
meantime.

yaid.c

diff --git a/yaid.c b/yaid.c
index 2548caf..cc3bb47 100644 (file)
--- a/yaid.c
+++ b/yaid.c
@@ -365,8 +365,8 @@ static void cancel_proxy(struct proxy *px)
     selbuf_destroy(&px->b);
     free_writebuf(&px->wb);
   }
-  selbuf_enable(&px->c->b);
   px->c->px = 0;
+  selbuf_enable(&px->c->b);
   xfree(px);
 }