Explorar o código

conn: fix potential framer reuse in prepare (#1112)

Don't put the framer into the pool when we may return it on the iter which when closed will return it to the pool.
Chris Bannister %!s(int64=7) %!d(string=hai) anos
pai
achega
ed13cda9d6
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  1. 1 2
      conn.go

+ 1 - 2
conn.go

@@ -1107,9 +1107,8 @@ func (c *Conn) executeBatch(batch *Batch) *Iter {
 			c.session.stmtsLRU.remove(key)
 		}
 
-		framerPool.Put(framer)
-
 		if found {
+			framerPool.Put(framer)
 			return c.executeBatch(batch)
 		} else {
 			return &Iter{err: x, framer: framer}