summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libglusterfs/src/xlator.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index f956908bba3..1bff11fecde 100644
--- a/libglusterfs/src/xlator.c
+++ b/libglusterfs/src/xlator.c
@@ -577,7 +577,8 @@ loc_copy (loc_t *dst, loc_t *src)
if (!dst->path)
goto out;
- dst->name = strrchr (dst->path, '/');
+ if (src->name)
+ dst->name = strrchr (dst->path, '/');
if (dst->name)
dst->name++;
}