mirror of
https://github.com/postgres/postgres.git
synced 2025-04-27 22:56:53 +03:00
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:
parent
202b56ba91
commit
00cf40328a
@ -5159,6 +5159,10 @@ _complete_from_query(const char *simple_query,
|
|||||||
|
|
||||||
/* Clean up */
|
/* Clean up */
|
||||||
termPQExpBuffer(&query_buffer);
|
termPQExpBuffer(&query_buffer);
|
||||||
|
if (schemaname)
|
||||||
|
free(schemaname);
|
||||||
|
if (objectname)
|
||||||
|
free(objectname);
|
||||||
free(e_object_like);
|
free(e_object_like);
|
||||||
if (e_schemaname)
|
if (e_schemaname)
|
||||||
free(e_schemaname);
|
free(e_schemaname);
|
||||||
|
@ -1227,4 +1227,7 @@ patternToSQLRegex(int encoding, PQExpBuffer dbnamebuf, PQExpBuffer schemabuf,
|
|||||||
appendPQExpBufferStr(dbnamebuf, curbuf->data);
|
appendPQExpBufferStr(dbnamebuf, curbuf->data);
|
||||||
termPQExpBuffer(curbuf);
|
termPQExpBuffer(curbuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (want_literal_dbname)
|
||||||
|
termPQExpBuffer(&left_literal);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user