Commit 5e40dd0
committed
Work around optimization bug
For some reason, the compiler is optimizing out a memset() that
clears the yaml_event_t at the end of yaml_event_delete(), which
is called implicitly by yaml_emitter_emit(). As a result, the
cleanup at the end of the function ends up performing a
double-free.
This works around the problem by always assuming that the
yaml_event_delete() routine worked properly and just forces the
event.type field to zero, thereby preventing any future calls to
yaml_event_delete() from attempting to free() memory.
Signed-off-by: Stephen Gallagher <[email protected]>1 parent 51ace79 commit 5e40dd0
1 file changed
+4
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| 127 | + | |
127 | 128 | | |
128 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
129 | 132 | | |
130 | 133 | | |
131 | 134 | | |
| |||
0 commit comments