aboutsummaryrefslogtreecommitdiff
path: root/libnetfs
diff options
context:
space:
mode:
Diffstat (limited to 'libnetfs')
-rw-r--r--libnetfs/make-peropen.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libnetfs/make-peropen.c b/libnetfs/make-peropen.c
index 4bd74740..3b127881 100644
--- a/libnetfs/make-peropen.c
+++ b/libnetfs/make-peropen.c
@@ -34,7 +34,10 @@ netfs_make_peropen (struct node *np, int flags, struct peropen *context)
po->filepointer = 0;
err = fshelp_rlock_po_init (&po->lock_status);
if (err)
- return NULL;
+ {
+ free (po);
+ return NULL;
+ }
refcount_init (&po->refcnt, 1);
po->openstat = flags;
po->np = np;
@@ -46,7 +49,8 @@ netfs_make_peropen (struct node *np, int flags, struct peropen *context)
{
po->path = strdup (context->path);
if (! po->path) {
- free(po);
+ fshelp_rlock_po_fini (&po->lock_status);
+ free (po);
return NULL;
}
}