about summary refs log tree commit diff
path: root/hurd
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2008-07-22 20:21:19 +0000
committerRoland McGrath <roland@gnu.org>2008-07-22 20:21:19 +0000
commit7385c04c8c477ff3728a61d9335628337cf9edc1 (patch)
tree2f5b2222a3f70f194477ba6ac9806a817e072e4f /hurd
parent8a26088de1d5bef2f46e87006ff72c795a83b2d9 (diff)
downloadglibc-7385c04c8c477ff3728a61d9335628337cf9edc1.tar.gz
glibc-7385c04c8c477ff3728a61d9335628337cf9edc1.tar.xz
glibc-7385c04c8c477ff3728a61d9335628337cf9edc1.zip
* hurd/fd-read.c (_hurd_fd_read): Fix last change.
Diffstat (limited to 'hurd')
-rw-r--r--hurd/fd-read.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/hurd/fd-read.c b/hurd/fd-read.c
index d673c78e03..38706524f0 100644
--- a/hurd/fd-read.c
+++ b/hurd/fd-read.c
@@ -42,7 +42,10 @@ _hurd_fd_read (struct hurd_fd *fd, void *buf, size_t *nbytes, loff_t offset)
   if (data != buf)
     {
       if (nread > *nbytes)	/* Sanity check for bogus server.  */
-	return EGRATUITOUS;
+	{
+	  __vm_deallocate (__mach_task_self (), (vm_address_t) data, nread);
+	  return EGRATUITOUS;
+	}
       memcpy (buf, data, nread);
       __vm_deallocate (__mach_task_self (), (vm_address_t) data, nread);
     }