On 2020-10-14, Cág <[email protected]> wrote: > I think it never made it to the list. > > --- > ed.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/ed.c b/ed.c > index cee9687..9e29297 100644 > --- a/ed.c > +++ b/ed.c > @@ -850,6 +850,7 @@ join(void) > delete(line1, line2); > inject(s.str, BEFORE); > free(s.str); > + s.str = NULL;
This works, but I'm not sure why `s` is static here, since it is cleared at the start of the function, and freed at the end of the function. Maybe I'm missing something, but I think it would be better to replace the first `free(s.str)` with `s.str = NULL`, and make `s` have automatic storage. > } > > static void > -- > 2.25.1
