diff options
author | Michael Paquier <michael@paquier.xyz> | 2024-09-19 16:25:07 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2024-09-19 16:25:07 +0900 |
commit | b0ae6db2088bbd1d16733b359c9c300735e9c21e (patch) | |
tree | 0750d102ee960ff53b674517c0a4746edc63d417 /src/bin/psql/common.h | |
parent | 19b389c60871cd14b07dfb244a519d8cb83988cc (diff) |
psql: Fix memory leak with repeated calls of \bind
Calling \bind repeatedly would cause the memory allocated for the list
of bind parameters to be leaked after each call, as the list is reset
when beginning a single call.
This issue is fixed by making the cleanup of the bind parameter list
more aggressive, refactoring it into a single routine called after
processing a query and before running an individual \bind.
HEAD required more surgery and has been fixed by 87eeadaea143. Issue
introduced by 5b66de3433e2.
Reported-by: Anthonin Bonnefoy
Discussion: https://postgr.es/m/2e5b89af-a351-ff0a-000c-037ac28314ab@gmail.com
Backpatch-through: 16
Diffstat (limited to 'src/bin/psql/common.h')
-rw-r--r-- | src/bin/psql/common.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/bin/psql/common.h b/src/bin/psql/common.h index 6efe12274fe..9baa1e89064 100644 --- a/src/bin/psql/common.h +++ b/src/bin/psql/common.h @@ -41,6 +41,7 @@ extern bool standard_strings(void); extern const char *session_username(void); extern void expand_tilde(char **filename); +extern void clean_bind_state(void); extern bool recognized_connection_string(const char *connstr); |