diff options
author | Vijay Bellur <vijay@gluster.com> | 2009-06-21 01:28:51 +0000 |
---|---|---|
committer | Anand V. Avati <avati@dev.gluster.com> | 2009-06-22 12:29:12 -0700 |
commit | 96896689b4e774af6460905b30adabec6e1fa540 (patch) | |
tree | aa55f9df0e555e2c81ec9f3e4a74859b5574d7c2 | |
parent | ae1201785ca7f14690d19c533bb8a7f5150ea29b (diff) |
Avoid accessing local unconditionally in trash_common_*_cbk functions.
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
-rw-r--r-- | xlators/features/trash/src/trash.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/xlators/features/trash/src/trash.c b/xlators/features/trash/src/trash.c index b2c4a9ab396..fa5d752eab7 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; } |