From 8b5b2bfcda0dc95aa170b8752ad97d94701172f2 Mon Sep 17 00:00:00 2001 From: "Christopher R. Hertel" Date: Mon, 27 Jan 2014 16:38:14 -0600 Subject: performance/quick-read: Allocated memory not freed when not used. If memory is successfully allocated in the call to qr_content_extract(), but is not used, it is not being freed. This patch frees the allocated memory if it is not passed to qr_content_refresh(). BUG: 789278 CID: 1124735 Change-Id: I1c1f03a3b92fa26321ec6ee8822e6fa41da79875 Signed-off-by: Christopher R. Hertel Reviewed-on: http://review.gluster.org/6827 Tested-by: Gluster Build System Reviewed-by: Anand Avati --- xlators/performance/quick-read/src/quick-read.c | 5 +++-- 1 file 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 21197c767..402da886f 100644 --- a/xlators/performance/quick-read/src/quick-read.c +++ b/xlators/performance/quick-read/src/quick-read.c @@ -418,10 +418,11 @@ qr_lookup_cbk (call_frame_t *frame, void *cookie, xlator_t *this, if (content) { /* new content came along, always replace old content */ qr_inode = qr_inode_ctx_get_or_new (this, inode); - if (!qr_inode) + if (!qr_inode) { /* no harm done */ + GF_FREE (content); goto out; - + } qr_content_update (this, qr_inode, content, buf); } else { /* purge old content if necessary */ -- cgit