forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8a81778
committed
Fix two low-probability memory leaks in regular expression parsing.
If pg_regcomp failed after having invoked markst/cleanst, it would leak any"struct subre" nodes it had created. (We've already detected all regexsyntax errors at that point, so the only likely causes of later failurewould be query cancel or out-of-memory.) To fix, make sure freesrnodeknows the difference between the pre-cleanst and post-cleanst cleanupprocedures. Add some documentation of this less-than-obvious point.Also, newlacon did the wrong thing with an out-of-memory failure fromrealloc(), so that the previously allocated array would be leaked.Both of these are pretty low-probability scenarios, but a bug is a bug,so patch all the way back.Per bug #10976 from Arthur O'Dwyer.1 parenta41dc73 commit8a81778
1 file changed
+24
-7
lines changedLines changed: 24 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1663 | 1663 |
| |
1664 | 1664 |
| |
1665 | 1665 |
| |
1666 |
| - | |
| 1666 | + | |
1667 | 1667 |
| |
| 1668 | + | |
1668 | 1669 |
| |
1669 | 1670 |
| |
1670 | 1671 |
| |
| |||
1710 | 1711 |
| |
1711 | 1712 |
| |
1712 | 1713 |
| |
| 1714 | + | |
| 1715 | + | |
| 1716 | + | |
| 1717 | + | |
| 1718 | + | |
| 1719 | + | |
| 1720 | + | |
| 1721 | + | |
| 1722 | + | |
| 1723 | + | |
| 1724 | + | |
| 1725 | + | |
| 1726 | + | |
| 1727 | + | |
1713 | 1728 |
| |
1714 | 1729 |
| |
1715 | 1730 |
| |
| |||
1807 | 1822 |
| |
1808 | 1823 |
| |
1809 | 1824 |
| |
| 1825 | + | |
1810 | 1826 |
| |
1811 | 1827 |
| |
1812 | 1828 |
| |
1813 | 1829 |
| |
1814 |
| - | |
1815 | 1830 |
| |
1816 |
| - | |
| 1831 | + | |
1817 | 1832 |
| |
1818 | 1833 |
| |
1819 | 1834 |
| |
1820 |
| - | |
1821 |
| - | |
1822 |
| - | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
1823 | 1838 |
| |
1824 |
| - | |
| 1839 | + | |
1825 | 1840 |
| |
1826 | 1841 |
| |
1827 | 1842 |
| |
1828 | 1843 |
| |
| 1844 | + | |
| 1845 | + | |
1829 | 1846 |
| |
1830 | 1847 |
| |
1831 | 1848 |
| |
|
0 commit comments
Comments
(0)