forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit131ea3e
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 parent99cea49 commit131ea3e
1 file changed
+11
-7
lines changedLines changed: 11 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
233 | 233 |
| |
234 | 234 |
| |
235 | 235 |
| |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
236 | 247 |
| |
237 | 248 |
| |
238 | 249 |
| |
| |||
276 | 287 |
| |
277 | 288 |
| |
278 | 289 |
| |
279 |
| - | |
280 |
| - | |
281 |
| - | |
282 |
| - | |
283 |
| - | |
284 |
| - | |
285 |
| - | |
286 | 290 |
| |
287 | 291 |
| |
288 | 292 |
| |
|
0 commit comments
Comments
(0)