summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--xlators/storage/posix/src/posix.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix.c b/xlators/storage/posix/src/posix.c
index 36d2c857835..c89ef7d92ad 100644
--- a/xlators/storage/posix/src/posix.c
+++ b/xlators/storage/posix/src/posix.c
@@ -3598,6 +3598,7 @@ posix_links_in_same_directory (char *dirpath, int count, inode_t *leaf_inode,
+ strlen (temppath) + 1 );
if (!tempv) {
GF_FREE (*path);
+ *path = NULL;
op_ret = -1;
*op_errno = ENOMEM;
goto out;
@@ -3612,6 +3613,7 @@ posix_links_in_same_directory (char *dirpath, int count, inode_t *leaf_inode,
count--;
}
+ op_ret = 0;
out:
if (dirp) {
op_ret = closedir (dirp);
@@ -3802,6 +3804,11 @@ posix_get_ancestry (xlator_t *this, inode_t *leaf_inode,
}
out:
+ if (ret && path && *path) {
+ GF_FREE (*path);
+ *path = NULL;
+ }
+
return ret;
}