ed: remove double free in join()

This commit is contained in:
Thomas Mannay 2016-10-09 23:13:13 +00:00 committed by Laslo Hunhold
parent 2304df908c
commit 30da327fbd

3
ed.c
View File

@ -809,9 +809,8 @@ join(void)
int i;
char *t, c;
size_t len = 0, cap = 0;
static char *s;
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);