Commit aea7bf1
committed
Add CodeQL query to check allocations do not exceed ensure_free
The query also checks redundant ensure_free calls, i.e. calls
followed by another call with no allocation in between.
Fix errors found by the query:
- Add a missing ensure_free in esp32 `dac_driver.c`
- Fix and simplify allocation in `adc_driver.c` (fix misplaced
parenthesis bug and merge two ensure_free calls into one)
- Remove redundant ensure_free calls in `otp_ssl.c` (left over
from removal of `enif_make_resource` which used to do its own
ensure_free)
- Remove a redundant ensure_free call in `nif_erlang_fun_to_list`
Signed-off-by: Paul Guyot <pguyot@kallisys.net>1 parent d2d58f5 commit aea7bf1
File tree
10 files changed
+557
-45
lines changed- .github/workflows
- code-queries
- src
- libAtomVM
- platforms/esp32/components/avm_builtins
10 files changed
+557
-45
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
165 | | - | |
| 165 | + | |
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
127 | 137 | | |
128 | 138 | | |
129 | 139 | | |
| |||
134 | 144 | | |
135 | 145 | | |
136 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
137 | 150 | | |
138 | 151 | | |
139 | 152 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| |||
0 commit comments