Fixed a big memory leak: _user_writev() and _user_readv() allocated
a new iovec array, but only freed them on (early) error. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@13666 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
16046321cc
commit
d7013609a8
@ -430,7 +430,7 @@ _user_readv(int fd, off_t pos, const iovec *userVecs, size_t count)
|
|||||||
bytesRead = B_BAD_VALUE;
|
bytesRead = B_BAD_VALUE;
|
||||||
|
|
||||||
put_fd(descriptor);
|
put_fd(descriptor);
|
||||||
return bytesRead;
|
status = bytesRead;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
free(vecs);
|
free(vecs);
|
||||||
@ -523,7 +523,7 @@ _user_writev(int fd, off_t pos, const iovec *userVecs, size_t count)
|
|||||||
bytesWritten = B_BAD_VALUE;
|
bytesWritten = B_BAD_VALUE;
|
||||||
|
|
||||||
put_fd(descriptor);
|
put_fd(descriptor);
|
||||||
return bytesWritten;
|
status = bytesWritten;
|
||||||
|
|
||||||
err:
|
err:
|
||||||
free(vecs);
|
free(vecs);
|
||||||
|
Loading…
Reference in New Issue
Block a user