summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
Diffstat (limited to 'xlators')
-rw-r--r--xlators/performance/quick-read/src/quick-read.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c
index 465881080a4..90663337a70 100644
--- a/xlators/performance/quick-read/src/quick-read.c
+++ b/xlators/performance/quick-read/src/quick-read.c
@@ -81,6 +81,7 @@ qr_loc_fill (loc_t *loc, inode_t *inode, char *path)
{
int32_t ret = -1;
char *parent = NULL;
+ char *path_copy = NULL;
GF_VALIDATE_OR_GOTO_WITH_ERROR ("quick-read", loc, out, errno, EINVAL);
GF_VALIDATE_OR_GOTO_WITH_ERROR ("quick-read", inode, out, errno,
@@ -93,13 +94,13 @@ qr_loc_fill (loc_t *loc, inode_t *inode, char *path)
loc->path = gf_strdup (path);
loc->ino = inode->ino;
- parent = gf_strdup (path);
- if (parent == NULL) {
+ path_copy = gf_strdup (path);
+ if (path_copy == NULL) {
ret = -1;
goto out;
}
- parent = dirname (parent);
+ parent = dirname (path_copy);
loc->parent = inode_from_path (inode->table, parent);
if (loc->parent == NULL) {
@@ -117,8 +118,8 @@ out:
qr_loc_wipe (loc);
}
- if (parent) {
- GF_FREE (parent);
+ if (path_copy) {
+ GF_FREE (path_copy);
}
return ret;