fix some acme memory leaks
(imported from plan9port 7ca1c90109e17dced4b38fbaadea9d2cf39871b7, some tag restoration lines not relevant.)
This commit is contained in:
parent
450ec696ee
commit
480d7b8f5f
2 changed files with 6 additions and 2 deletions
|
@ -307,15 +307,18 @@ static int errorfd;
|
|||
void
|
||||
acmeerrorproc(void *)
|
||||
{
|
||||
char *buf;
|
||||
char *buf, *s;
|
||||
int n;
|
||||
|
||||
threadsetname("acmeerrorproc");
|
||||
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
|
||||
|
|
|
@ -159,6 +159,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");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue