diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2023-04-23 19:05:47 +0300 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2023-04-24 22:44:18 +0200 |
commit | 4c39333050815a33ddf4f3067798ac060eed1e2b (patch) | |
tree | a2899959f9fe13775b3727e51898b8e44bde2c24 /sysdeps/mach/hurd/recvfrom.c | |
parent | 70b9173caa3a6e8e4cc1c8ebe93ed15a19388687 (diff) | |
download | glibc-4c39333050815a33ddf4f3067798ac060eed1e2b.tar.gz glibc-4c39333050815a33ddf4f3067798ac060eed1e2b.tar.xz glibc-4c39333050815a33ddf4f3067798ac060eed1e2b.zip |
hurd: Only deallocate addrport when it's valid
Signed-off-by: Sergey Bugaev <bugaevc@gmail.com> Message-Id: <20230423160548.126576-3-bugaevc@gmail.com>
Diffstat (limited to 'sysdeps/mach/hurd/recvfrom.c')
-rw-r--r-- | sysdeps/mach/hurd/recvfrom.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sysdeps/mach/hurd/recvfrom.c b/sysdeps/mach/hurd/recvfrom.c index 1cd5f91746..6f2c927ab6 100644 --- a/sysdeps/mach/hurd/recvfrom.c +++ b/sysdeps/mach/hurd/recvfrom.c @@ -94,7 +94,8 @@ __recvfrom (int fd, void *buf, size_t n, int flags, __SOCKADDR_ARG addrarg, else if (addr_len != NULL) *addr_len = 0; - __mach_port_deallocate (__mach_task_self (), addrport); + if (MACH_PORT_VALID (addrport)) + __mach_port_deallocate (__mach_task_self (), addrport); /* Toss control data; we don't care. */ __vm_deallocate (__mach_task_self (), (vm_address_t) cdata, clen); |