To suppress memory leakage in long-lived Lists, lremove() should pfree
Tom Lane <tgl@sss.pgh.pa.us>
To suppress memory leakage in long-lived Lists, lremove() should pfree the cons cell it's deleting from the list. Do this, and fix a few callers that were bogusly assuming it wouldn't free the cons cell.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/nodes/list.c | modified | +4 −2 |
| src/backend/optimizer/path/pathkeys.c | modified | +8 −5 |
| src/backend/optimizer/plan/initsplan.c | modified | +7 −4 |
| src/backend/parser/analyze.c | modified | +20 −13 |
| src/backend/rewrite/rewriteHandler.c | modified | +4 −2 |
| src/backend/utils/adt/selfuncs.c | modified | +8 −6 |