Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit00cf403

Browse files
committed
Fix minor memory leaks in psql's tab completion.
Tang Haiying and Tom LaneDiscussion:https://postgr.es/m/OS0PR01MB6113EA19F05E217C823B4CCAFB909@OS0PR01MB6113.jpnprd01.prod.outlook.com
1 parent202b56b commit00cf403

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)

[8]ページ先頭

©2009-2025 Movatter.jp