Дана 25/11/20 03:27PM, Santtu Lakkala написа:
> Skip calling free() on s.str in join() to avoid double-free by string()
> in next invocation.
[...]
>       addchar('\0', &s);
>       delete(line1, line2);
>       inject(s.str, BEFORE);
> -     free(s.str);
>  }

Maybe instead of removing that line, do something like:

        free(s.str);
        s.str = NULL;

so the next call to free(3) will just silently return?

Reply via email to