commit-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[hurd] 12/19: pfinet: fix memory leak


From: Samuel Thibault
Subject: [hurd] 12/19: pfinet: fix memory leak
Date: Wed, 10 Aug 2016 00:05:50 +0000

This is an automated email from the git hooks/post-receive script.

sthibault pushed a commit to branch upstream
in repository hurd.

commit bc170131016969f1d79409337833046ae1f4501b
Author: Richard Braun <address@hidden>
Date:   Tue Jun 14 14:01:12 2016 +0200

    pfinet: fix memory leak
    
    * pfinet/socket-ops.c (S_socket_recv): Unmap data on error.
---
 pfinet/socket-ops.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/pfinet/socket-ops.c b/pfinet/socket-ops.c
index 14b3120..c768602 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;

-- 
Alioth's /usr/local/bin/git-commit-notice on 
/srv/git.debian.org/git/pkg-hurd/hurd.git



reply via email to

[Prev in Thread] Current Thread [Next in Thread]