forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitab8c84d
committed
Prevent memory leaks in RelationGetIndexList, RelationGetIndexAttrBitmap.
When replacing rd_indexlist, rd_indexattr, etc, we neglected to pfree anyold value of these fields. Under ordinary circumstances, the old valuewould always be NULL, so this seemed reasonable enough. However, in caseswhere we're rebuilding a system catalog's relcache entry and another cacheflush occurs on that same catalog meanwhile, it's possible for the field tonot be NULL when we return to the outer level, because we already refilledit while recovering from the inner flush. This leads to a fairly smallsession-lifespan leak in CacheMemoryContext. In real-world usage the leakwould be too small to notice; but in testing with CLOBBER_CACHE_RECURSIVELYthe leakage can add up to the point of causing OOM failures, as reported byTomas Vondra.The issue has been there a long time, but it only seems worth fixing inHEAD, like the previous fix in this area (commit078b2ed).1 parent52bffe3 commitab8c84d
1 file changed
+13
-0
lines changedLines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3646 | 3646 |
| |
3647 | 3647 |
| |
3648 | 3648 |
| |
| 3649 | + | |
3649 | 3650 |
| |
3650 | 3651 |
| |
3651 | 3652 |
| |
| |||
3737 | 3738 |
| |
3738 | 3739 |
| |
3739 | 3740 |
| |
| 3741 | + | |
3740 | 3742 |
| |
3741 | 3743 |
| |
3742 | 3744 |
| |
| |||
3748 | 3750 |
| |
3749 | 3751 |
| |
3750 | 3752 |
| |
| 3753 | + | |
| 3754 | + | |
| 3755 | + | |
3751 | 3756 |
| |
3752 | 3757 |
| |
3753 | 3758 |
| |
| |||
4141 | 4146 |
| |
4142 | 4147 |
| |
4143 | 4148 |
| |
| 4149 | + | |
| 4150 | + | |
| 4151 | + | |
| 4152 | + | |
| 4153 | + | |
| 4154 | + | |
| 4155 | + | |
| 4156 | + | |
4144 | 4157 |
| |
4145 | 4158 |
| |
4146 | 4159 |
| |
|
0 commit comments
Comments
(0)