- Notifications
You must be signed in to change notification settings - Fork5
Commit546454f
committed
Fix intratransaction memory leaks in xml_recv, xmlconcat, xmlroot, and
xml_parse, all arising from the same sloppy usage of parse_xml_decl.The original coding had that function returning its output stringparameters in the libxml context, which is long-lived, and all but oneof its callers neglected to free the strings afterwards. The easiestand most bulletproof fix is to return the strings in the local palloccontext instead, since that's short-lived. This was only costing adozen or two bytes per function call, but that adds up fast if thefunction is called repeatedly ...Noted while poking at the more general problem of what to do with ourlibxml memory allocation hooks. Back-patch to 8.3, which has theidentical coding.1 parentf23bdda commit546454f
1 file changed
+28
-12
lines changedLines changed: 28 additions & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
7 | 7 |
| |
8 | 8 |
| |
9 | 9 |
| |
10 |
| - | |
| 10 | + | |
11 | 11 |
| |
12 | 12 |
| |
13 | 13 |
| |
| |||
236 | 236 |
| |
237 | 237 |
| |
238 | 238 |
| |
239 |
| - | |
240 |
| - | |
241 | 239 |
| |
242 | 240 |
| |
243 | 241 |
| |
| |||
455 | 453 |
| |
456 | 454 |
| |
457 | 455 |
| |
458 |
| - | |
| 456 | + | |
459 | 457 |
| |
460 | 458 |
| |
461 | 459 |
| |
| |||
918 | 916 |
| |
919 | 917 |
| |
920 | 918 |
| |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
921 | 937 |
| |
922 | 938 |
| |
923 | 939 |
| |
| |||
930 | 946 |
| |
931 | 947 |
| |
932 | 948 |
| |
| 949 | + | |
933 | 950 |
| |
934 | 951 |
| |
935 | 952 |
| |
| |||
971 | 988 |
| |
972 | 989 |
| |
973 | 990 |
| |
974 |
| - | |
| 991 | + | |
975 | 992 |
| |
976 | 993 |
| |
977 | 994 |
| |
| |||
999 | 1016 |
| |
1000 | 1017 |
| |
1001 | 1018 |
| |
1002 |
| - | |
| 1019 | + | |
1003 | 1020 |
| |
1004 | 1021 |
| |
1005 | 1022 |
| |
| |||
1172 | 1189 |
| |
1173 | 1190 |
| |
1174 | 1191 |
| |
1175 |
| - | |
1176 |
| - | |
1177 | 1192 |
| |
1178 | 1193 |
| |
1179 | 1194 |
| |
1180 | 1195 |
| |
1181 | 1196 |
| |
1182 | 1197 |
| |
1183 | 1198 |
| |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
1184 | 1204 |
| |
1185 | 1205 |
| |
1186 | 1206 |
| |
1187 | 1207 |
| |
1188 | 1208 |
| |
1189 |
| - | |
1190 |
| - | |
1191 |
| - | |
1192 |
| - | |
1193 | 1209 |
| |
1194 | 1210 |
| |
1195 | 1211 |
| |
|
0 commit comments
Comments
(0)