- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitf24605e
committed
Fix memory leak in XMLSERIALIZE(... INDENT).
xmltotext_with_options sometimes tries to replace the existingroot node of a libxml2 document. In that case xmlDocSetRootElementwill unlink and return the old root node; if we fail to free it,it's leaked for the remainder of the session. The amount of memoryat stake is not large, a couple hundred bytes per occurrence, butthat could still become annoying in heavy usage.Our only other xmlDocSetRootElement call is not at risk becauseit's working on a just-created document, but let's modify thatcode too to make it clear that it's dependent on that.Author: Tom Lane <tgl@sss.pgh.pa.us>Reviewed-by: Jim Jones <jim.jones@uni-muenster.de>Discussion:https://postgr.es/m/1358967.1747858817@sss.pgh.pa.usBackpatch-through: 161 parent5d6eac8 commitf24605e
1 file changed
+17
-4
lines changedLines changed: 17 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
754 | 754 |
| |
755 | 755 |
| |
756 | 756 |
| |
| 757 | + | |
757 | 758 |
| |
758 | 759 |
| |
759 | 760 |
| |
760 | 761 |
| |
761 | 762 |
| |
762 | 763 |
| |
763 | 764 |
| |
764 |
| - | |
765 |
| - | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
766 | 773 |
| |
767 | 774 |
| |
768 | 775 |
| |
| |||
1850 | 1857 |
| |
1851 | 1858 |
| |
1852 | 1859 |
| |
| 1860 | + | |
1853 | 1861 |
| |
1854 | 1862 |
| |
1855 | 1863 |
| |
| |||
1868 | 1876 |
| |
1869 | 1877 |
| |
1870 | 1878 |
| |
1871 |
| - | |
1872 |
| - | |
| 1879 | + | |
| 1880 | + | |
| 1881 | + | |
| 1882 | + | |
| 1883 | + | |
| 1884 | + | |
| 1885 | + | |
1873 | 1886 |
| |
1874 | 1887 |
| |
1875 | 1888 |
| |
|
0 commit comments
Comments
(0)