Commit eceae93
committed
Fix pointer cleanup on dynamic allocation failure
When using a custom alloc/free implementation, allocation may fail,
in which case the cleanup section needs to zeroize and free those
pointers there were successfully allocated, and skip those for which
allocation failed. This skipping of failed allocations is not
implemented correctly and would lead to a null pointer dereference.
This commit fixes this.
Signed-off-by: Hanno Becker <beckphan@amazon.co.uk>1 parent dab806c commit eceae93
1 file changed
Lines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
196 | 199 | | |
197 | 200 | | |
198 | 201 | | |
| |||
0 commit comments