Commit 3efc952
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, just call exit,
invoking the signal handler too.
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>1 parent 8ee78d9 commit 3efc952
2 files changed
+18
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
147 | | - | |
148 | 147 | | |
149 | 148 | | |
150 | 149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
22 | 28 | | |
23 | 29 | | |
24 | 30 | | |
| |||
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
54 | | - | |
| 60 | + | |
| 61 | + | |
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
| |||
96 | 103 | | |
97 | 104 | | |
98 | 105 | | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| |||
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
213 | | - | |
| 214 | + | |
214 | 215 | | |
215 | 216 | | |
216 | 217 | | |
| |||
220 | 221 | | |
221 | 222 | | |
222 | 223 | | |
| 224 | + | |
223 | 225 | | |
224 | 226 | | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | 227 | | |
235 | 228 | | |
236 | | - | |
237 | | - | |
| 229 | + | |
238 | 230 | | |
239 | | - | |
240 | | - | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
241 | 236 | | |
242 | | - | |
243 | | - | |
| 237 | + | |
| 238 | + | |
244 | 239 | | |
245 | 240 | | |
246 | 241 | | |
0 commit comments