mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-18 10:35:55 +00:00
Fix a leak where a scratch buffer was not freed when reading from the
/dev/?random devices. This appears to have been missed when the code was brought across from the i386. (This should fix the "world build hangs with everything waiting on 'temp' problem.) Also add some iovec fixup code in the error path which seems to have been similarly fixed. There are a number of other differences between the i386 and alpha version which have not been examined. This code should still be considered suspect.
This commit is contained in:
parent
64cb419d61
commit
6d7d302695
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=60494
@ -297,7 +297,15 @@ mmrw(dev, uio, flags)
|
||||
default:
|
||||
return (ENXIO);
|
||||
}
|
||||
if (error)
|
||||
break;
|
||||
iov->iov_base += c;
|
||||
iov->iov_len -= c;
|
||||
uio->uio_offset += c;
|
||||
uio->uio_resid -= c;
|
||||
}
|
||||
if (buf)
|
||||
free(buf, M_TEMP);
|
||||
return (error);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user