summaryrefslogtreecommitdiffstats
path: root/xlators/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/protocol')
-rw-r--r--xlators/protocol/server/src/server-helpers.c3
-rw-r--r--xlators/protocol/server/src/server-protocol.c8
2 files changed, 7 insertions, 4 deletions
diff --git a/xlators/protocol/server/src/server-helpers.c b/xlators/protocol/server/src/server-helpers.c
index c7e7f32d54a..a4e0b20815b 100644
--- a/xlators/protocol/server/src/server-helpers.c
+++ b/xlators/protocol/server/src/server-helpers.c
@@ -193,6 +193,9 @@ free_state (server_state_t *state)
if (state->xattr_req)
dict_unref (state->xattr_req);
+ if (state->volume)
+ FREE (state->volume);
+
FREE (state);
}
diff --git a/xlators/protocol/server/src/server-protocol.c b/xlators/protocol/server/src/server-protocol.c
index ed75e97ebc2..9bba95544d3 100644
--- a/xlators/protocol/server/src/server-protocol.c
+++ b/xlators/protocol/server/src/server-protocol.c
@@ -6064,7 +6064,7 @@ server_inodelk (call_frame_t *frame,
vollen = STRLEN_0(req->volume + vollen);
state->path = req->path;
- state->volume = req->volume + vollen;
+ state->volume = strdup (req->volume + vollen);
state->ino = ntoh64 (req->ino);
gf_flock_to_flock (&req->flock, &state->flock);
@@ -6117,7 +6117,7 @@ server_finodelk (call_frame_t *frame,
req = gf_param (hdr);
state = CALL_STATE(frame);
{
- state->volume = req->volume;
+ state->volume = strdup (req->volume);
state->fd_no = ntoh64 (req->fd);
if (state->fd_no >= 0)
@@ -6240,7 +6240,7 @@ server_entrylk (call_frame_t *frame,
state->name = req->name + pathlen;
vollen = STRLEN_0(req->volume + pathlen + namelen);
- state->volume = req->volume + pathlen + namelen;
+ state->volume = strdup (req->volume + pathlen + namelen);
state->cmd = ntoh32 (req->cmd);
state->type = ntoh32 (req->type);
@@ -6297,7 +6297,7 @@ server_fentrylk (call_frame_t *frame,
state->name = req->name;
vollen = STRLEN_0(req->volume + namelen);
- state->volume = req->volume + namelen;
+ state->volume = strdup (req->volume + namelen);
}
if (state->fd == NULL) {