1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-16 06:01:02 +03:00

psql: Fix memory leak with \gx used within a pipeline

While inside a pipeline, \gx is currently forbidden and will make
exec_command_g() exit early.  There was a memory leak in this code path,
so let's fix it.

Author: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Discussion: https://postgr.es/m/CAO6_XqqFVQjLjZQiL7xdwLpzZEy1ghO_JWvCFPM_OmwF9s7XdA@mail.gmail.com
This commit is contained in:
Michael Paquier
2025-03-05 07:56:03 +09:00
parent b229c10164
commit 54d23601b9

View File

@ -1739,6 +1739,7 @@ exec_command_g(PsqlScanState scan_state, bool active_branch, const char *cmd)
{
pg_log_error("\\gx not allowed in pipeline mode");
clean_extended_state();
free(fname);
return PSQL_CMD_ERROR;
}