bug-hurd
[Top][All Lists]
Advanced

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

[PATCH] Fixed leaks in _netfs_translator_callback2_fn


From: James Clarke
Subject: [PATCH] Fixed leaks in _netfs_translator_callback2_fn
Date: Sun, 7 Feb 2016 22:51:42 +0000

* libnetfs/trans-callback.c (_netfs_translator_callback2_fn): Fixed leaking
iouser and peropen structs on error.
---
 libnetfs/trans-callback.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libnetfs/trans-callback.c b/libnetfs/trans-callback.c
index 3f1aee6..7816bd1 100644
--- a/libnetfs/trans-callback.c
+++ b/libnetfs/trans-callback.c
@@ -67,7 +67,10 @@ _netfs_translator_callback2_fn (void *cookie1, void 
*cookie2, int flags,
 
   po = netfs_make_peropen (node, flags, cookie2);
   if (! po)
-    return errno;
+    {
+      iohelp_free_iouser (user);
+      return errno;
+    }
 
   cred = netfs_make_protid (po, user);
   if (cred)
@@ -79,6 +82,7 @@ _netfs_translator_callback2_fn (void *cookie1, void *cookie2, 
int flags,
     }
   else
     {
+      netfs_release_peropen (po);
       iohelp_free_iouser (user);
       return errno;
     }
-- 
2.7.1




reply via email to

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