forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit9cf1632
committed
Fix plancache refcount leak after error in ExecuteQuery.
When stuffing a plan from the plancache into a Portal, one isnot supposed to risk throwing an error between GetCachedPlan andPortalDefineQuery; if that happens, the plan refcount incrementedby GetCachedPlan will be leaked. I managed to break this rulewhile refactoring code in9dbf2b7. There is no visibleconsequence other than some memory leakage, and since nobody isvery likely to trigger the relevant error conditions many timesin a row, it's not surprising we haven't noticed. Nonetheless,it's a bug, so rearrange the order of operations to remove thehazard.Noted on the way to looking for a better fix for bug #17053.This mistake is pretty old, so back-patch to all supportedbranches.1 parentc0a7587 commit9cf1632
1 file changed
+11
-7
lines changedLines changed: 11 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
246 | 246 |
| |
247 | 247 |
| |
248 | 248 |
| |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
249 | 260 |
| |
250 | 261 |
| |
251 | 262 |
| |
| |||
289 | 300 |
| |
290 | 301 |
| |
291 | 302 |
| |
292 |
| - | |
293 |
| - | |
294 |
| - | |
295 |
| - | |
296 |
| - | |
297 |
| - | |
298 |
| - | |
299 | 303 |
| |
300 | 304 |
| |
301 | 305 |
| |
|
0 commit comments
Comments
(0)