diff options
author | James Clarke <jrtc27@jrtc27.com> | 2016-02-07 23:18:11 +0000 |
---|---|---|
committer | Justus Winter <4winter@informatik.uni-hamburg.de> | 2016-02-08 10:41:04 +0100 |
commit | 23f66dec527cea00bd5613c6d52d22a50b54f3d0 (patch) | |
tree | 4af75dec7ff005e76adbe0bdf88bfc57559ecd8a /libnetfs/trans-callback.c | |
parent | da578dac78504aa00d0b0bc1d929c4df63dcf5cd (diff) |
Fixed leaks in _netfs_translator_callback2_fn
* libnetfs/trans-callback.c (_netfs_translator_callback2_fn): Fixed leaking
iouser and peropen structs on error.
Diffstat (limited to 'libnetfs/trans-callback.c')
-rw-r--r-- | libnetfs/trans-callback.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libnetfs/trans-callback.c b/libnetfs/trans-callback.c index 3f1aee6a..ed21aa2a 100644 --- a/libnetfs/trans-callback.c +++ b/libnetfs/trans-callback.c @@ -67,7 +67,11 @@ _netfs_translator_callback2_fn (void *cookie1, void *cookie2, int flags, po = netfs_make_peropen (node, flags, cookie2); if (! po) - return errno; + { + err = errno; + iohelp_free_iouser (user); + return err; + } cred = netfs_make_protid (po, user); if (cred) @@ -79,8 +83,10 @@ _netfs_translator_callback2_fn (void *cookie1, void *cookie2, int flags, } else { + err = errno; + netfs_release_peropen (po); iohelp_free_iouser (user); - return errno; + return err; } } |