diff options
author | Petter Rodhelind <petter.rodhelind@gmail.com> | 2018-04-20 19:39:01 +0200 |
---|---|---|
committer | Petter Rodhelind <petter.rodhelind@gmail.com> | 2018-04-20 19:39:01 +0200 |
commit | 79223bb49d950dc6236b6c79c37fea787e40ba5c (patch) | |
tree | bb85b2a21fa74e8792704b056cc163c38fcc55c2 /src/cmd/acme | |
parent | c04683ef3aa6e9f42fb279025f231b06b17191f4 (diff) | |
parent | 03a8ec739af17bc4ba0a2e18ea59b33671c34f2b (diff) | |
download | plan9port-79223bb49d950dc6236b6c79c37fea787e40ba5c.tar.gz plan9port-79223bb49d950dc6236b6c79c37fea787e40ba5c.tar.bz2 plan9port-79223bb49d950dc6236b6c79c37fea787e40ba5c.zip |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/cmd/acme')
-rw-r--r-- | src/cmd/acme/acme.c | 7 | ||||
-rw-r--r-- | src/cmd/acme/exec.c | 1 | ||||
-rw-r--r-- | src/cmd/acme/rows.c | 2 |
3 files changed, 8 insertions, 2 deletions
diff --git a/src/cmd/acme/acme.c b/src/cmd/acme/acme.c index 10dcdcc8..742aabdf 100644 --- a/src/cmd/acme/acme.c +++ b/src/cmd/acme/acme.c @@ -383,7 +383,7 @@ int erroutfd; void acmeerrorproc(void *v) { - char *buf; + char *buf, *s; int n; USED(v); @@ -391,8 +391,11 @@ acmeerrorproc(void *v) buf = emalloc(8192+1); while((n=read(errorfd, buf, 8192)) >= 0){ buf[n] = '\0'; - sendp(cerr, estrdup(buf)); + s = estrdup(buf); + sendp(cerr, s); + free(s); } + free(buf); } void diff --git a/src/cmd/acme/exec.c b/src/cmd/acme/exec.c index fbc249d8..7ad28872 100644 --- a/src/cmd/acme/exec.c +++ b/src/cmd/acme/exec.c @@ -197,6 +197,7 @@ execute(Text *t, uint aq0, uint aq1, int external, Text *argt) aa = getbytearg(argt, TRUE, TRUE, &a); if(a){ if(strlen(a) > EVENTSIZE){ /* too big; too bad */ + free(r); free(aa); free(a); warning(nil, "argument string too long\n"); diff --git a/src/cmd/acme/rows.c b/src/cmd/acme/rows.c index 2d6cbcca..8cff0855 100644 --- a/src/cmd/acme/rows.c +++ b/src/cmd/acme/rows.c @@ -613,6 +613,7 @@ rowload(Row *row, char *file, int initing) } textdelete(&row->col[i]->tag, 0, row->col[i]->tag.file->b.nc, TRUE); textinsert(&row->col[i]->tag, 0, r+n+1, nr-(n+1), TRUE); + free(r); break; case 'w': l[Blinelen(b)-1] = 0; @@ -626,6 +627,7 @@ rowload(Row *row, char *file, int initing) } textdelete(&row->tag, 0, row->tag.file->b.nc, TRUE); textinsert(&row->tag, 0, r, nr, TRUE); + free(r); break; default: done = 1; |