summaryrefslogtreecommitdiffstats
path: root/xlators/features/quota/src/quota.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/features/quota/src/quota.c')
-rw-r--r--xlators/features/quota/src/quota.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c
index e67a4325fc7..22d1bb9f30f 100644
--- a/xlators/features/quota/src/quota.c
+++ b/xlators/features/quota/src/quota.c
@@ -40,10 +40,11 @@ __quota_init_inode_ctx (inode_t *inode, xlator_t *this,
INIT_LIST_HEAD (&ctx->parents);
ret = __inode_ctx_put (inode, this, (uint64_t )(long)ctx);
- if (ret == -1) {
+ if (ret) {
gf_msg (this->name, GF_LOG_WARNING, 0,
Q_MSG_INODE_CTX_SET_FAILED, "cannot set quota context "
"in inode (gfid:%s)", uuid_utoa (inode->gfid));
+ GF_FREE (ctx);
}
out:
return ret;