Content-Length: 257052 | pFad | http://github.com/postgrespro/postgres/commit/54d23601b978d2552696fb7fe35ae5d6102ea2cb

21 psql: Fix memory leak with \gx used within a pipeline · postgrespro/postgres@54d2360 · GitHub
Skip to content

Commit 54d2360

Browse files
committed
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
1 parent b229c10 commit 54d2360

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/bin/psql/command.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1739,6 +1739,7 @@ exec_command_g(PsqlScanState scan_state, bool active_branch, const char *cmd)
17391739
{
17401740
pg_log_error("\\gx not allowed in pipeline mode");
17411741
clean_extended_state();
1742+
free(fname);
17421743
return PSQL_CMD_ERROR;
17431744
}
17441745

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/54d23601b978d2552696fb7fe35ae5d6102ea2cb

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy