forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit73eba19
committed
Fix another ancient memory-leak bug in relcache.c.
CheckConstraintFetch() leaked a cstring in the caller's context for eachCHECK constraint expression it copied into the relcache. Ordinarily thatisn't problematic, but it can be during CLOBBER_CACHE testing because somany reloads can happen during a single query; so complicate the codeslightly to allow freeing the cstring after use. Per testing on buildfarmmember barnacle.This is exactly like the leak fixed in AttrDefaultFetch() by commit078b2ed. (Yes, this time I did look forother instances of the same coding pattern :-(.) Like that patch, noback-patch, since it seems unlikely that there's any problem except undervery artificial test conditions.BTW, it strikes me that both of these places would require further workcomparable to commitab8c84d, if we eversupported defaults or check constraints on system catalogs: they bothassume they are copying into an empty relcache data structure, and thatconceivably wouldn't be the case during recursive reloading of a systemcatalog. This does not seem worth worrying about for the moment, sincethere is no near-term prospect of supporting any such thing. So I'lljust note the possibility for the archives' sake.1 parent256bfb2 commit73eba19
1 file changed
+8
-4
lines changedLines changed: 8 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3552 | 3552 |
| |
3553 | 3553 |
| |
3554 | 3554 |
| |
3555 |
| - | |
3556 |
| - | |
3557 | 3555 |
| |
3558 | 3556 |
| |
3559 | 3557 |
| |
| |||
3568 | 3566 |
| |
3569 | 3567 |
| |
3570 | 3568 |
| |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
3571 | 3572 |
| |
3572 | 3573 |
| |
3573 | 3574 |
| |
| |||
3590 | 3591 |
| |
3591 | 3592 |
| |
3592 | 3593 |
| |
3593 |
| - | |
3594 |
| - | |
| 3594 | + | |
| 3595 | + | |
| 3596 | + | |
| 3597 | + | |
| 3598 | + | |
3595 | 3599 |
| |
3596 | 3600 |
| |
3597 | 3601 |
| |
|
0 commit comments
Comments
(0)