diff options
-rw-r--r-- | pfinet/socket-ops.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/pfinet/socket-ops.c b/pfinet/socket-ops.c index 14b3120c..c7686026 100644 --- a/pfinet/socket-ops.c +++ b/pfinet/socket-ops.c @@ -521,7 +521,11 @@ S_socket_recv (struct sock_user *user, pthread_mutex_unlock (&global_lock); if (err < 0) - err = -err; + { + err = -err; + if (alloced) + munmap (*data, amount); + } else { *datalen = err; |