Re: [hackers] [sbase][PATCH 3/4] ed: Fix double-free in join
Дана 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?
Received on Sun Nov 23 2025 - 11:17:28 CET
This archive was generated by hypermail 2.3.0
: Sun Nov 23 2025 - 11:24:36 CET