Commit 92bee97
io limit: fix double free (#16459)
io limit: fix double free.
In 'alterResgroupCallback', the io_limit pointer of 'caps' and 'oldCaps'
maybe point to the same location, so there is a double free potentially.
In 'alterResgroupCallback', the 'oldCaps' will be filled in
'GetResGroupCapabilities', and the assign it to 'caps' via:
caps = oldCaps
To resolve this problem, the code should free the oldCaps.io_limit, and
set it to NIL, when the io_limit has not been altered.
So, if the io_limit has not been altered, caps.io_limit =
oldCaps.io_limit = NIL. If io_limit has been altered, caps.io_limit !=
oldCaps.io_limit.1 parent 6080221 commit 92bee97
3 files changed
Lines changed: 24 additions & 3 deletions
File tree
- src
- backend/commands
- test/isolation2
- input/resgroup
- output/resgroup
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
438 | 438 | | |
439 | 439 | | |
440 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
441 | 447 | | |
442 | 448 | | |
443 | 449 | | |
| |||
479 | 485 | | |
480 | 486 | | |
481 | 487 | | |
| 488 | + | |
| 489 | + | |
482 | 490 | | |
483 | 491 | | |
484 | 492 | | |
| |||
1123 | 1131 | | |
1124 | 1132 | | |
1125 | 1133 | | |
1126 | | - | |
| 1134 | + | |
1127 | 1135 | | |
1128 | 1136 | | |
1129 | 1137 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
| |||
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
70 | | - | |
71 | 72 | | |
| 73 | + | |
72 | 74 | | |
73 | 75 | | |
74 | 76 | | |
| 77 | + | |
| 78 | + | |
75 | 79 | | |
76 | 80 | | |
77 | 81 | | |
| |||
Lines changed: 10 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
110 | 113 | | |
111 | 114 | | |
112 | 115 | | |
| |||
134 | 137 | | |
135 | 138 | | |
136 | 139 | | |
137 | | - | |
138 | 140 | | |
| 141 | + | |
139 | 142 | | |
140 | 143 | | |
141 | 144 | | |
| |||
147 | 150 | | |
148 | 151 | | |
149 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
150 | 159 | | |
151 | 160 | | |
152 | 161 | | |
| |||
0 commit comments