sel/bres.c (zap): Don't scramble the freelist when a query is aborted.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 19 Jul 2014 16:14:11 +0000 (17:14 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 19 Jul 2014 16:14:11 +0000 (17:14 +0100)
commita736dc9c17aa9ba7cd65b092a7817a6c7853672a
tree4c07eb9c993e65cbdbe6b3d42b29b461a3dd384b
parente744e21a5aa1e4e5820999ac1e6776fa8fe76dd8
sel/bres.c (zap): Don't scramble the freelist when a query is aborted.

If a query is aborted after it's been committed to a server process,
then we kill the server and return its control block to the freelist.
Unfortunately, the function which does this, `zap', unconditionally
tries to unlink the control block from its current position in the
freelist; but it wasn't actually there before.  The result is that
another server control block might be linked back into the freelist.
Attaching a second client to it while it's already in use fails when
`attach' tries to remove the server's idle timer, which isn't active: at
this point, we get a segfault.
sel/bres.c