ref: 6716e9ba20e378efe32924813c531943373afc46
parent: f763dc164092f5a4652c65feab358130857f0622
author: cinap_lenrek <[email protected]>
date: Mon Oct 7 08:51:21 EDT 2019
sshfs: fix dir2attrib() memory leak in wstat error case (thanks BurnZeZ)
--- a/sys/src/cmd/sshfs.c
+++ b/sys/src/cmd/sshfs.c
@@ -569,7 +569,7 @@
int uid, gid;
werrstr("phase error");
- r = emalloc9p(MAXATTRIB);
+ *rp = r = emalloc9p(MAXATTRIB);
e = r + MAXATTRIB;
fl = 0;
p = r + 4;
@@ -604,7 +604,6 @@
rc = pack(p, e - p, "uu", d->atime, d->mtime); if(rc < 0) return -1; p += rc;
}
PUT4(r, fl);
- *rp = r;
return p - r;
}
@@ -929,6 +928,7 @@
if(x < 0){
responderror(r->req);
putsreq(r);
+ free(s);
break;
}
rlock(sf);