Content-Length: 285356 | pFad | http://github.com/postgrespro/postgres/commit/00cf40328a3178b0be69ac75549fc5d6857b77c3

B5 Fix minor memory leaks in psql's tab completion. · postgrespro/postgres@00cf403 · GitHub
Skip to content

Commit 00cf403

Browse files
committed
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
1 parent 202b56b commit 00cf403

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/bin/psql/tab-complete.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5159,6 +5159,10 @@ _complete_from_query(const char *simple_query,
51595159

51605160
/* Clean up */
51615161
termPQExpBuffer(&query_buffer);
5162+
if (schemaname)
5163+
free(schemaname);
5164+
if (objectname)
5165+
free(objectname);
51625166
free(e_object_like);
51635167
if (e_schemaname)
51645168
free(e_schemaname);

src/fe_utils/string_utils.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,4 +1227,7 @@ patternToSQLRegex(int encoding, PQExpBuffer dbnamebuf, PQExpBuffer schemabuf,
12271227
appendPQExpBufferStr(dbnamebuf, curbuf->data);
12281228
termPQExpBuffer(curbuf);
12291229
}
1230+
1231+
if (want_literal_dbname)
1232+
termPQExpBuffer(&left_literal);
12301233
}

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/00cf40328a3178b0be69ac75549fc5d6857b77c3

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy