- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitee58de1
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 parent0d20635 commitee58de1
1 file changed
+17
-4
lines changedLines changed: 17 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
733 | 733 |
| |
734 | 734 |
| |
735 | 735 |
| |
| 736 | + | |
736 | 737 |
| |
737 | 738 |
| |
738 | 739 |
| |
739 | 740 |
| |
740 | 741 |
| |
741 | 742 |
| |
742 | 743 |
| |
743 |
| - | |
744 |
| - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
745 | 752 |
| |
746 | 753 |
| |
747 | 754 |
| |
| |||
1829 | 1836 |
| |
1830 | 1837 |
| |
1831 | 1838 |
| |
| 1839 | + | |
1832 | 1840 |
| |
1833 | 1841 |
| |
1834 | 1842 |
| |
| |||
1847 | 1855 |
| |
1848 | 1856 |
| |
1849 | 1857 |
| |
1850 |
| - | |
1851 |
| - | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
1852 | 1865 |
| |
1853 | 1866 |
| |
1854 | 1867 |
| |
|
0 commit comments
Comments
(0)