From 735714edca08e2de16c0e447f8c3256913186ce6 Mon Sep 17 00:00:00 2001 From: Raghavendra Bhat Date: Thu, 29 Mar 2012 16:31:24 +0530 Subject: features/locks: check whether dict is NULL before refing it Change-Id: I8906b80e584466aceb5a7402e3cee6ac2a552fab BUG: 808003 Signed-off-by: Raghavendra Bhat Reviewed-on: http://review.gluster.com/3036 Tested-by: Gluster Build System Reviewed-by: Jeff Darcy --- xlators/features/locks/src/posix.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index 81cfc7f91..15b68fac7 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; -- cgit