diff options
author | Christopher R. Hertel <crh@redhat.com> | 2014-01-27 16:38:14 -0600 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2014-02-08 11:30:01 -0800 |
commit | 8b5b2bfcda0dc95aa170b8752ad97d94701172f2 (patch) | |
tree | 3eb4ddff0d674ca16ad3be552d5203ff3eed1cdc /xlators/performance/quick-read | |
parent | 14792bd894e7838efdc8f50a16af5445b448dc2e (diff) |
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 <crh@redhat.com>
Reviewed-on: http://review.gluster.org/6827
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/performance/quick-read')
-rw-r--r-- | xlators/performance/quick-read/src/quick-read.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xlators/performance/quick-read/src/quick-read.c b/xlators/performance/quick-read/src/quick-read.c index 21197c767c9..402da886fb6 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 */ |