forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit30c66e7
committed
Fix SPI error cleanup and memory leak
Since the SPI stack has been moved from TopTransactionContext toTopMemoryContext, setting _SPI_stack to NULL in AtEOXact_SPI() leaksmemory. In fact, we don't need to do that anymore: We just leave theallocated stack around for the next SPI use.Also, refactor the SPI cleanup so that it is run both at transaction endand when returning to the main loop on an exception. The latter isnecessary when a procedure calls a COMMIT or ROLLBACK command thatitself causes an error.1 parenta365f52 commit30c66e7
File tree
3 files changed
+19
-14
lines changed- src
- backend
- executor
- tcop
- include/executor
3 files changed
+19
-14
lines changedLines changed: 16 additions & 14 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
260 | 260 |
| |
261 | 261 |
| |
262 | 262 |
| |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
263 | 277 |
| |
264 | 278 |
| |
265 | 279 |
| |
266 | 280 |
| |
267 | 281 |
| |
268 | 282 |
| |
269 |
| - | |
270 |
| - | |
271 |
| - | |
| 283 | + | |
272 | 284 |
| |
273 | 285 |
| |
274 | 286 |
| |
275 |
| - | |
276 |
| - | |
277 |
| - | |
278 |
| - | |
279 |
| - | |
280 | 287 |
| |
281 | 288 |
| |
282 | 289 |
| |
283 | 290 |
| |
284 | 291 |
| |
285 | 292 |
| |
286 |
| - | |
287 |
| - | |
288 |
| - | |
289 |
| - | |
290 |
| - | |
291 |
| - | |
| 293 | + | |
292 | 294 |
| |
293 | 295 |
| |
294 | 296 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
42 | 42 |
| |
43 | 43 |
| |
44 | 44 |
| |
| 45 | + | |
45 | 46 |
| |
46 | 47 |
| |
47 | 48 |
| |
| |||
3941 | 3942 |
| |
3942 | 3943 |
| |
3943 | 3944 |
| |
| 3945 | + | |
3944 | 3946 |
| |
3945 | 3947 |
| |
3946 | 3948 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
163 | 163 |
| |
164 | 164 |
| |
165 | 165 |
| |
| 166 | + | |
166 | 167 |
| |
167 | 168 |
| |
168 | 169 |
| |
|
0 commit comments
Comments
(0)