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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy