From 96896689b4e774af6460905b30adabec6e1fa540 Mon Sep 17 00:00:00 2001 From: Vijay Bellur Date: Sun, 21 Jun 2009 01:28:51 +0000 Subject: Avoid accessing local unconditionally in trash_common_*_cbk functions. Signed-off-by: Anand V. Avati --- xlators/features/trash/src/trash.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'xlators/features/trash') diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index b2c4a9ab3..fa5d752ea 100644 --- a/xlators/features/trash/src/trash.c +++ b/xlators/features/trash/src/trash.c @@ -77,12 +77,16 @@ trash_common_unwind_cbk (call_frame_t *frame, { trash_local_t *local = frame->local; + if (!local) + goto out; + if (local->loc1.path) loc_wipe (&local->loc1); if (local->loc2.path) loc_wipe (&local->loc2); + out: STACK_UNWIND (frame, op_ret, op_errno); return 0; } @@ -100,12 +104,16 @@ trash_common_unwind_buf_cbk (call_frame_t *frame, { trash_local_t *local = frame->local; + if (!local) + goto out; + if (local->loc1.path) loc_wipe (&local->loc1); if (local->loc2.path) loc_wipe (&local->loc2); + out: STACK_UNWIND (frame, op_ret, op_errno, buf); return 0; } -- cgit