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
This commit is contained in:
Tom Lane 2022-07-22 10:53:26 -04:00
parent 7d158e8cb4
commit 90474c16a7
2 changed files with 5 additions and 0 deletions

View File

@ -5158,6 +5158,8 @@ _complete_from_query(const char *simple_query,
/* Clean up */
termPQExpBuffer(&query_buffer);
free(schemaname);
free(objectname);
free(e_object_like);
free(e_schemaname);
free(e_ref_object);

View File

@ -1225,4 +1225,7 @@ patternToSQLRegex(int encoding, PQExpBuffer dbnamebuf, PQExpBuffer schemabuf,
appendPQExpBufferStr(dbnamebuf, curbuf->data);
termPQExpBuffer(curbuf);
}
if (want_literal_dbname)
termPQExpBuffer(&left_literal);
}