ed: remove double free in join()
This commit is contained in:
parent
2304df908c
commit
30da327fbd
3
ed.c
3
ed.c
@ -809,9 +809,8 @@ join(void)
|
|||||||
int i;
|
int i;
|
||||||
char *t, c;
|
char *t, c;
|
||||||
size_t len = 0, cap = 0;
|
size_t len = 0, cap = 0;
|
||||||
static char *s;
|
char *s;
|
||||||
|
|
||||||
free(s);
|
|
||||||
for (s = NULL, i = line1;; i = nextln(i)) {
|
for (s = NULL, i = line1;; i = nextln(i)) {
|
||||||
for (t = gettxt(i); (c = *t) != '\n'; ++t)
|
for (t = gettxt(i); (c = *t) != '\n'; ++t)
|
||||||
s = addchar(*t, s, &cap, &len);
|
s = addchar(*t, s, &cap, &len);
|
||||||
|
Loading…
Reference in New Issue
Block a user