mirror of
https://github.com/9fans/plan9port.git
synced 2025-01-24 11:41:58 +00:00
Bug fixes from the Valgrind oracle.
This commit is contained in:
parent
ceb0477083
commit
e95a70884b
3 changed files with 4 additions and 1 deletions
|
@ -11,6 +11,7 @@ static int
|
|||
mygetdents(int fd, struct dirent *buf, int n)
|
||||
{
|
||||
off_t off;
|
||||
int nn;
|
||||
|
||||
off = p9seek(fd, 0, 1);
|
||||
nn = getdirentries(fd, (void*)buf, n, &off);
|
||||
|
|
|
@ -199,7 +199,7 @@ _fsgetfid(Fsys *fs)
|
|||
|
||||
qlock(&fs->lk);
|
||||
if(fs->freefid == nil){
|
||||
f = malloc(sizeof(Fid)*Fidchunk);
|
||||
f = mallocz(sizeof(Fid)*Fidchunk, 1);
|
||||
if(f == nil){
|
||||
qunlock(&fs->lk);
|
||||
return nil;
|
||||
|
|
|
@ -81,6 +81,7 @@ muxrpc(Mux *mux, void *tx)
|
|||
}
|
||||
r2 = mux->wait[tag];
|
||||
r2->p = p;
|
||||
dequeue(mux, r2);
|
||||
rwakeup(&r2->r);
|
||||
}
|
||||
mux->muxer = 0;
|
||||
|
@ -131,6 +132,7 @@ gettag(Mux *mux, Muxrpc *r)
|
|||
w = realloc(mux->wait, mw*sizeof(w[0]));
|
||||
if(w == nil)
|
||||
return -1;
|
||||
memset(w+mux->mwait, 0, (mw-mux->mwait)*sizeof(w[0]));
|
||||
mux->wait = w;
|
||||
mux->freetag = mux->mwait;
|
||||
mux->mwait = mw;
|
||||
|
|
Loading…
Reference in a new issue