Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+1
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)