commit 78bfd8978ea2af10dadc3fdadd19710068a632c4 Author: Roberto E. Vargas Caballero <roberto.var...@igrid-td.com> AuthorDate: Tue Jan 10 08:41:35 2017 +0100 Commit: Roberto E. Vargas Caballero <roberto.var...@igrid-td.com> CommitDate: Tue Jan 10 08:41:35 2017 +0100
Revert "ed: remove double free in join()" This reverts commit 30da327fbd27eee508c5492a763ea19d7cd9e281. The double free is needed to avoid memory leaks when signals are caught diff --git a/ed.c b/ed.c index 52b2684..f579116 100644 --- a/ed.c +++ b/ed.c @@ -813,8 +813,9 @@ join(void) int i; char *t, c; size_t len = 0, cap = 0; - char *s; + static char *s; + free(s); for (s = NULL, i = line1;; i = nextln(i)) { for (t = gettxt(i); (c = *t) != '\n'; ++t) s = addchar(*t, s, &cap, &len);