summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorRaghavendra Bhat <raghavendrabhat@gluster.com>2012-03-29 16:31:24 +0530
committerVijay Bellur <vijay@gluster.com>2012-03-29 07:47:11 -0700
commit735714edca08e2de16c0e447f8c3256913186ce6 (patch)
tree07ecbd78e737eaf27dbb1a86b778558690997be8 /xlators
parent3fb9ee6caa3325423ac221b5f24e980c24edafde (diff)
features/locks: check whether dict is NULL before refing it
Change-Id: I8906b80e584466aceb5a7402e3cee6ac2a552fab BUG: 808003 Signed-off-by: Raghavendra Bhat <raghavendrabhat@gluster.com> Reviewed-on: http://review.gluster.com/3036 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/features/locks/src/posix.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
index 81cfc7f9178..15b68fac7fd 100644
--- a/xlators/features/locks/src/posix.c
+++ b/xlators/features/locks/src/posix.c
@@ -219,6 +219,10 @@ unwind:
"error: %s", op_ret, strerror (op_errno));
if (local->op == TRUNCATE)
loc_wipe (&local->loc);
+ if (local->xdata)
+ dict_unref (local->xdata);
+ if (local->fd)
+ fd_unref (local->fd);
STACK_UNWIND_STRICT (truncate, frame, op_ret, op_errno, buf, NULL, xdata);
return 0;
@@ -237,7 +241,8 @@ pl_truncate (call_frame_t *frame, xlator_t *this,
local->op = TRUNCATE;
local->offset = offset;
loc_copy (&local->loc, loc);
- local->xdata = dict_ref (xdata);
+ if (xdata)
+ local->xdata = dict_ref (xdata);
frame->local = local;