Commit b07e1fe
committed
microcom.c: Call cleanup routines only once
Repeated call to ios->exit(ios); was observed as used after free using
asan. Only call it once: In the exit handler.
Always call the exit handler and check there whether listenonly is set
and there skip resetting the terminal if so.
Do not reset the terminal elsewhere.
Do not call the exit handler from the quit command, call exit instead.
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>1 parent 4dab97e commit b07e1fe
2 files changed
+19
-26
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
149 | 149 | | |
150 | 150 | | |
151 | 151 | | |
152 | | - | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
40 | 46 | | |
41 | 47 | | |
42 | 48 | | |
| |||
69 | 75 | | |
70 | 76 | | |
71 | 77 | | |
72 | | - | |
73 | | - | |
74 | | - | |
| 78 | + | |
| 79 | + | |
75 | 80 | | |
76 | 81 | | |
77 | 82 | | |
| |||
113 | 118 | | |
114 | 119 | | |
115 | 120 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
| |||
233 | 232 | | |
234 | 233 | | |
235 | 234 | | |
236 | | - | |
| 235 | + | |
237 | 236 | | |
238 | 237 | | |
239 | 238 | | |
| |||
243 | 242 | | |
244 | 243 | | |
245 | 244 | | |
| 245 | + | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | 248 | | |
258 | 249 | | |
259 | | - | |
260 | | - | |
| 250 | + | |
261 | 251 | | |
262 | | - | |
263 | | - | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
264 | 257 | | |
265 | | - | |
266 | | - | |
| 258 | + | |
| 259 | + | |
267 | 260 | | |
268 | 261 | | |
269 | 262 | | |
0 commit comments