aboutsummaryrefslogtreecommitdiff
path: root/src/fe_utils/string_utils.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2022-07-22 10:53:26 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2022-07-22 10:53:26 -0400
commit90474c16a7d24991586aa97c78b880fe9c072aba (patch)
tree72c9d2a8e51c076e84c400ca0edb1f6fff18b419 /src/fe_utils/string_utils.c
parent7d158e8cb44b602ab76a3660b9f5f5c5c5992a1f (diff)
downloadpostgresql-90474c16a7d24991586aa97c78b880fe9c072aba.tar.gz
postgresql-90474c16a7d24991586aa97c78b880fe9c072aba.zip
Fix minor memory leaks in psql's tab completion.
Tang Haiying and Tom Lane Discussion: https://postgr.es/m/OS0PR01MB6113EA19F05E217C823B4CCAFB909@OS0PR01MB6113.jpnprd01.prod.outlook.com
Diffstat (limited to 'src/fe_utils/string_utils.c')
-rw-r--r--src/fe_utils/string_utils.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fe_utils/string_utils.c b/src/fe_utils/string_utils.c
index f9ea08705af..a2fa7a0c26a 100644
--- a/src/fe_utils/string_utils.c
+++ b/src/fe_utils/string_utils.c
@@ -1225,4 +1225,7 @@ patternToSQLRegex(int encoding, PQExpBuffer dbnamebuf, PQExpBuffer schemabuf,
appendPQExpBufferStr(dbnamebuf, curbuf->data);
termPQExpBuffer(curbuf);
}
+
+ if (want_literal_dbname)
+ termPQExpBuffer(&left_literal);
}