• Heikki Linnakangas's avatar
    Fix dangling smgr_owner pointer when a fake relcache entry is freed. · 55566c9a
    Heikki Linnakangas authored
    A fake relcache entry can "own" a SmgrRelation object, like a regular
    relcache entry. But when it was free'd, the owner field in SmgrRelation
    was not cleared, so it was left pointing to free'd memory.
    
    Amazingly this apparently hasn't caused crashes in practice, or we would've
    heard about it earlier. Andres found this with Valgrind.
    
    Report and fix by Andres Freund, with minor modifications by me. Backpatch
    to all supported versions.
    55566c9a
smgr.c 22.5 KB