diff options
Diffstat (limited to 'xlators/features/read-only')
-rw-r--r-- | xlators/features/read-only/src/worm.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/xlators/features/read-only/src/worm.c b/xlators/features/read-only/src/worm.c index cc3d15b8b2a..f59663802e6 100644 --- a/xlators/features/read-only/src/worm.c +++ b/xlators/features/read-only/src/worm.c @@ -429,6 +429,13 @@ worm_create_cbk(call_frame_t *frame, void *cookie, xlator_t *this, read_only_priv_t *priv = NULL; dict_t *dict = NULL; + // In case of an error exit because fd can be NULL and this would + // cause an segfault when performing fsetxattr . We explicitly + // unwind to avoid future problems + if (op_ret < 0) { + goto out; + } + priv = this->private; GF_ASSERT(priv); if (priv->worm_file) { |