mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
acme: fix some memory leaks
This commit is contained in:
parent
96dc233091
commit
7ca1c90109
3 changed files with 8 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -194,6 +194,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");
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue