sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit 78bfd8978ea2af10dadc3fdadd19710068a632c4
parent 89f5f8431678640cc566b760ad9bf91e9994e48f
Author: Roberto E. Vargas Caballero <roberto.vargas@igrid-td.com>
Date:   Tue, 10 Jan 2017 08:41:35 +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

Diffstat:
Med.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git 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);