From c9e271df2970f573ffdb10580b7a1e4072ea9f7b Mon Sep 17 00:00:00 2001
From: Rulin Tang <smiletrl@yahoo.com>
Date: Thu, 19 Aug 2021 23:17:12 +0800
Subject: [PATCH] add missing pgx pool release for QueryRow

---
 pgxpool/pool.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pgxpool/pool.go b/pgxpool/pool.go
index 7f200622..516de53a 100644
--- a/pgxpool/pool.go
+++ b/pgxpool/pool.go
@@ -96,7 +96,7 @@ type Config struct {
 	// AfterConnect is called after a connection is established, but before it is added to the pool.
 	AfterConnect func(context.Context, *pgx.Conn) error
 
-	// BeforeAcquire is called before before a connection is acquired from the pool. It must return true to allow the
+	// BeforeAcquire is called before a connection is acquired from the pool. It must return true to allow the
 	// acquision or false to indicate that the connection should be destroyed and a different connection should be
 	// acquired.
 	BeforeAcquire func(context.Context, *pgx.Conn) bool
@@ -458,6 +458,7 @@ func (p *Pool) QueryRow(ctx context.Context, sql string, args ...interface{}) pg
 	if err != nil {
 		return errRow{err: err}
 	}
+	defer c.Release()
 
 	row := c.QueryRow(ctx, sql, args...)
 	return c.getPoolRow(row)