summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-entry.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-entry.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-entry.c b/xlators/cluster/afr/src/afr-self-heal-entry.c
index a5e698cd2cb..80608dbd262 100644
--- a/xlators/cluster/afr/src/afr-self-heal-entry.c
+++ b/xlators/cluster/afr/src/afr-self-heal-entry.c
@@ -351,9 +351,15 @@ build_child_loc (xlator_t *this, loc_t *child, loc_t *parent, char *name)
}
if (strcmp (parent->path, "/") == 0)
- asprintf ((char **)&child->path, "/%s", name);
+ ret = asprintf ((char **)&child->path, "/%s", name);
else
- asprintf ((char **)&child->path, "%s/%s", parent->path, name);
+ ret = asprintf ((char **)&child->path, "%s/%s", parent->path,
+ name);
+
+ if (-1 == ret) {
+ gf_log (this->name, GF_LOG_ERROR,
+ "asprintf failed while setting child path");
+ }
if (!child->path) {
gf_log (this->name, GF_LOG_ERROR,