foreach() and list_delete() don't mix.
Tom Lane <tgl@sss.pgh.pa.us>
foreach() and list_delete() don't mix. Fix crash when releasing duplicate entries in the encoding conversion cache list, caused by releasing the current entry of the list being chased by foreach(). We have a standard idiom for handling such cases, but this loop wasn't using it. This got broken in my recent rewrite of GUC assign hooks. Not sure how I missed this when testing the modified code, but I did. Per report from Peter.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/mb/mbutils.c | modified | +10 −2 |