Skip to content

Commit 8799b7d

Browse files
committed
release conn if desc table fails
1 parent ac33f72 commit 8799b7d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

conn_http_batch.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,9 +121,10 @@ func newBlock(h *httpConnect, release nativeTransportRelease, ctx context.Contex
121121
}
122122

123123
func (h *httpConnect) prepareBatch(ctx context.Context, release nativeTransportRelease, acquire nativeTransportAcquire, query string, opts driver.PrepareBatchOptions) (driver.Batch, error) {
124-
// release is not used for newBlock since the connection is held for the batch.
124+
// release is not used within newBlock since the connection is held for the batch.
125125
query, block, err := newBlock(h, func(nativeTransport, error) {}, ctx, query)
126126
if err != nil {
127+
release(h, err)
127128
return nil, fmt.Errorf("failed to init block for HTTP batch: %w", err)
128129
}
129130

0 commit comments

Comments
 (0)