summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2012-04-12 22:03:49 +0530
committerAnand Avati <avati@redhat.com>2012-04-12 15:08:26 -0700
commita3c61c6aea4045a6adafcc7350bd14f1e9c68ca1 (patch)
tree2e178440e142763c9b240b10816c4afa6584d136 /libglusterfs
parent918678dc8e5a8cac1ec2dea7f8d2b11a186f38eb (diff)
libglusterfs: loc_copy should set name only if src->name is set
Change-Id: If06d97dd1ff1293730e0cd4933f6ab3283f0475e BUG: 788051 Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Reviewed-on: http://review.gluster.com/3137 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'libglusterfs')
-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++;
}