Skip to content

Fix for #1098 [memory leaks]#1099

Merged
JelteF merged 7 commits into
pgbouncer:masterfrom
dmitry-lipetsk:fix1098-memory_leaks
Sep 14, 2024
Merged

Fix for #1098 [memory leaks]#1099
JelteF merged 7 commits into
pgbouncer:masterfrom
dmitry-lipetsk:fix1098-memory_leaks

Conversation

@dmitry-lipetsk

Copy link
Copy Markdown
Contributor

This PR fixes memory leaks in parse_database and parse_peer functions.

See #1098 for details.

This commit fixes a memory leaks in parse_database function.

1. Description of database can define 'host' and 'connect_query' twice. We should free previous strings

2. 'fail' section must release allocated strings for 'host' and 'connect_query' parameters
This commit fixes a memory leaks in parse_peer function.

1. Description of database can define 'host' twice. We should free the previous string

2. 'fail' section must release an allocated string of 'host' parameter
Comment thread src/loader.c Outdated
Comment thread src/loader.c Outdated

@JelteF JelteF left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The setting to NULL in the happy path and then the later Assert(NULL) calls are a bit unnecessary. Other than that this looks good.

dmitry-lipetsk and others added 3 commits August 18, 2024 12:47
@JelteF JelteF merged commit 20e94d6 into pgbouncer:master Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants