From e021078220c30e781ef016b42f8cee8229042bb1 Mon Sep 17 00:00:00 2001 From: Poornima Date: Thu, 30 Jan 2014 02:23:13 +0000 Subject: Fix for 'use after free' errors reported by coverity. Change-Id: I941fc89b2d696c7f227330321ed4bba3ed1deac4 BUG: 789278 Signed-off-by: Poornima Reviewed-on: http://review.gluster.org/6868 Reviewed-by: Raghavendra G Tested-by: Gluster Build System Reviewed-by: Vijay Bellur --- xlators/performance/quick-read/src/quick-read.c | 1 + xlators/performance/write-behind/src/write-behind.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'xlators') diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 445ea8658..1b19ab527 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -101,6 +101,7 @@ qr_inode_ctx_get_or_new (xlator_t *this, inode_t *inode) if (ret) { __qr_inode_prune (&priv->table, qr_inode); GF_FREE (qr_inode); + qr_inode = NULL; } } unlock: diff --git a/xlators/performance/write-behind/src/write-behind.c b/xlators/performance/write-behind/src/write-behind.c index 2be211fbf..b9cef1152 100644 --- a/xlators/performance/write-behind/src/write-behind.c +++ b/xlators/performance/write-behind/src/write-behind.c @@ -967,11 +967,11 @@ __wb_collapse_small_writes (wb_request_t *holder, wb_request_t *req) ret = iobref_add (iobref, iobuf); if (ret != 0) { - iobuf_unref (iobuf); - iobref_unref (iobref); gf_log (req->wb_inode->this->name, GF_LOG_WARNING, "cannot add iobuf (%p) into iobref (%p)", iobuf, iobref); + iobuf_unref (iobuf); + iobref_unref (iobref); goto out; } -- cgit