summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/stripe/src/stripe.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/stripe/src/stripe.c')
-rw-r--r--xlators/cluster/stripe/src/stripe.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/xlators/cluster/stripe/src/stripe.c b/xlators/cluster/stripe/src/stripe.c
index b3e87d31b5a..bdea45f3ed6 100644
--- a/xlators/cluster/stripe/src/stripe.c
+++ b/xlators/cluster/stripe/src/stripe.c
@@ -4402,10 +4402,15 @@ unlock:
out:
if (!count) {
/* all entries are directories */
- frame->local = NULL;
- STRIPE_STACK_UNWIND (readdir, frame, local->op_ret,
- local->op_errno, &local->entries, NULL);
- gf_dirent_free (&local->entries);
+ if (frame)
+ frame->local = NULL;
+ STRIPE_STACK_UNWIND (readdir, frame,
+ local ? local->op_ret : -1,
+ local ? local->op_errno : EINVAL,
+ local ? &local->entries : NULL,
+ NULL);
+ if (local)
+ gf_dirent_free (&local->entries);
stripe_local_wipe (local);
mem_put (local);
}