aboutsummaryrefslogtreecommitdiff
path: root/pfinet/socket-ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'pfinet/socket-ops.c')
-rw-r--r--pfinet/socket-ops.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/pfinet/socket-ops.c b/pfinet/socket-ops.c
index baeaad30..b9ce6c72 100644
--- a/pfinet/socket-ops.c
+++ b/pfinet/socket-ops.c
@@ -499,6 +499,11 @@ S_socket_recv (struct sock_user *user,
if (amount > *datalen)
{
*data = mmap (0, amount, PROT_READ|PROT_WRITE, MAP_ANON, 0, 0);
+ if (*data == MAP_FAILED)
+ /* Should check whether errno is indeed ENOMEM --
+ but this can't be done in a straightforward way,
+ because the glue headers #undef errno. */
+ return ENOMEM;
alloced = 1;
}