diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2013-10-24 14:03:26 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2013-10-24 14:05:34 +0300 |
commit | b0aa17706e210dec4e8d744eac1682e0c6a0a3b0 (patch) | |
tree | 5d6f4820f163fd60447c6fad0fce09aa43c99a3f /src | |
parent | 80eba5981e0fa8af93c3ea173745a13f2f38a043 (diff) | |
download | postgresql-b0aa17706e210dec4e8d744eac1682e0c6a0a3b0.tar.gz postgresql-b0aa17706e210dec4e8d744eac1682e0c6a0a3b0.zip |
Fix memory leak when an empty ident file is reloaded.
Hari Babu
Diffstat (limited to 'src')
-rw-r--r-- | src/backend/libpq/hba.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/backend/libpq/hba.c b/src/backend/libpq/hba.c index 91f6ced0d2f..1c75acc94b6 100644 --- a/src/backend/libpq/hba.c +++ b/src/backend/libpq/hba.c @@ -2235,7 +2235,7 @@ load_ident(void) } /* Loaded new file successfully, replace the one we use */ - if (parsed_ident_lines != NULL) + if (parsed_ident_lines != NIL) { foreach(parsed_line_cell, parsed_ident_lines) { @@ -2243,8 +2243,10 @@ load_ident(void) if (newline->ident_user[0] == '/') pg_regfree(&newline->re); } - MemoryContextDelete(parsed_ident_context); } + if (parsed_ident_context != NULL) + MemoryContextDelete(parsed_ident_context); + parsed_ident_context = ident_context; parsed_ident_lines = new_parsed_lines; |