pgsql: Avoid memory leak on error while parsing pg_stat_statements dump - Mailing list pgsql-committers

From Heikki Linnakangas
Subject pgsql: Avoid memory leak on error while parsing pg_stat_statements dump
Date
Msg-id E1w656j-001gd8-0W@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Avoid memory leak on error while parsing pg_stat_statements dump file

By using palloc() instead of raw malloc().

Reported-by: Gaurav Singh <gaurav.singh@yugabyte.com>
Reviewed-by: Lukas Fittl <lukas@fittl.com>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
Discussion: https://www.postgresql.org/message-id/CAEcQ1bYR9s4eQLFDjzzJHU8fj-MTbmRpW-9J-r2gsCn+HEsynw@mail.gmail.com
Backpatch-through: 14

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/92cf11171baf64723412c996c641e6cc124d11d6

Modified Files
--------------
contrib/pg_stat_statements/pg_stat_statements.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)


pgsql-committers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: pgsql: Avoid memory leak on error while parsing pg_stat_statements dump
Next
From: Heikki Linnakangas
Date:
Subject: pgsql: Refactor PredicateLockShmemInit to not reuse var for different t