diff options
Diffstat (limited to 'libglusterfs/src/xlator.c')
-rw-r--r-- | libglusterfs/src/xlator.c | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c index ec20029591e..bbd6df683a2 100644 --- a/libglusterfs/src/xlator.c +++ b/libglusterfs/src/xlator.c @@ -570,25 +570,21 @@ loc_copy (loc_t *dst, loc_t *src) if (src->parent) dst->parent = inode_ref (src->parent); - if (src->path) + if (src->path) { dst->path = gf_strdup (src->path); - if (!dst->path) - goto out; + if (!dst->path) + goto out; - dst->name = strrchr (dst->path, '/'); - if (dst->name) - dst->name++; + dst->name = strrchr (dst->path, '/'); + if (dst->name) + dst->name++; + } ret = 0; out: - if (ret == -1) { - if (dst->inode) - inode_unref (dst->inode); - - if (dst->parent) - inode_unref (dst->parent); - } + if (ret == -1) + loc_wipe (dst); err: return ret; |