forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit6c3b697
committed
Fix List memory issue in transformColumnDefinition
When calling generateSerialExtraStmts(), we would pass in theconstraint->options. In some cases, generateSerialExtraStmts() wouldmodify the referenced List to remove elements from it, but doing so isinvalid without assigning the list back to all variables that point to it.In the particular reported problem case, the List became empty, in whichcases it became NIL, but the passed in constraint->options didn't get tofind out about that and was left pointing to free'd memory.To fix this, just perform a list_copy() inside generateSerialExtraStmts().We could just do a list_copy() just before we perform the delete from thelist, however, that seems less robust. Let's make sure the generatedCreateSeqStmt gets a completely different copy of the list to be safe.Bug: #17879Reported-by: Fei ChanghongDiagnosed-by: Fei ChanghongDiscussion:https://postgr.es/m/17879-b7dfb5debee58ff5@postgresql.orgBackpatch-through: 11, all supported versions1 parent11c2d6f commit6c3b697
1 file changed
+3
-0
lines changedLines changed: 3 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
381 | 381 |
| |
382 | 382 |
| |
383 | 383 |
| |
| 384 | + | |
| 385 | + | |
| 386 | + | |
384 | 387 |
| |
385 | 388 |
| |
386 | 389 |
| |
|
0 commit comments
Comments
(0)