foreach() and list_delete() don't mix.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 17 Apr 2011 17:36:38 +0000 (13:36 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 17 Apr 2011 17:37:39 +0000 (13:37 -0400)
commit88dc6fa7a164c306d8a1295769edb818d8520a3f
treeadd8980eb2317b81f9adc9fa3edcbdfbf618f98c
parentd2f60a3ab055fb61c8e1056a7c5652f1dec85e00
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.
src/backend/utils/mb/mbutils.c