- Notifications
You must be signed in to change notification settings - Fork5
Commit1567e65
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 parent6cd471a commit1567e65
1 file changed
+24
-7
lines changedLines changed: 24 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1680 | 1680 |
| |
1681 | 1681 |
| |
1682 | 1682 |
| |
1683 |
| - | |
| 1683 | + | |
1684 | 1684 |
| |
| 1685 | + | |
1685 | 1686 |
| |
1686 | 1687 |
| |
1687 | 1688 |
| |
| |||
1727 | 1728 |
| |
1728 | 1729 |
| |
1729 | 1730 |
| |
| 1731 | + | |
| 1732 | + | |
| 1733 | + | |
| 1734 | + | |
| 1735 | + | |
| 1736 | + | |
| 1737 | + | |
| 1738 | + | |
| 1739 | + | |
| 1740 | + | |
| 1741 | + | |
| 1742 | + | |
| 1743 | + | |
| 1744 | + | |
1730 | 1745 |
| |
1731 | 1746 |
| |
1732 | 1747 |
| |
| |||
1824 | 1839 |
| |
1825 | 1840 |
| |
1826 | 1841 |
| |
| 1842 | + | |
1827 | 1843 |
| |
1828 | 1844 |
| |
1829 | 1845 |
| |
1830 | 1846 |
| |
1831 |
| - | |
1832 | 1847 |
| |
1833 |
| - | |
| 1848 | + | |
1834 | 1849 |
| |
1835 | 1850 |
| |
1836 | 1851 |
| |
1837 |
| - | |
1838 |
| - | |
1839 |
| - | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
1840 | 1855 |
| |
1841 |
| - | |
| 1856 | + | |
1842 | 1857 |
| |
1843 | 1858 |
| |
1844 | 1859 |
| |
1845 | 1860 |
| |
| 1861 | + | |
| 1862 | + | |
1846 | 1863 |
| |
1847 | 1864 |
| |
1848 | 1865 |
| |
|
0 commit comments
Comments
(0)