about summary refs log tree commit diff
path: root/sysdeps/mach/hurd/sendmsg.c
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/mach/hurd/sendmsg.c')
-rw-r--r--sysdeps/mach/hurd/sendmsg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sysdeps/mach/hurd/sendmsg.c b/sysdeps/mach/hurd/sendmsg.c
index 5871d1d8dd..7106faf0de 100644
--- a/sysdeps/mach/hurd/sendmsg.c
+++ b/sysdeps/mach/hurd/sendmsg.c
@@ -195,8 +195,9 @@ __libc_sendmsg (int fd, const struct msghdr *message, int flags)
 						   message->msg_controllen,
 						   &amount);
 			      LIBC_CANCEL_RESET (cancel_oldtype);
-			      __mach_port_deallocate (__mach_task_self (),
-						      aport);
+			      if (MACH_PORT_VALID (aport))
+				__mach_port_deallocate (__mach_task_self (),
+							aport);
 			    }
 			  err;
 			}));