From e1f92176a8d372e99386c0f007d6a38c0a54ca5b Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Wed, 19 Dec 2018 09:45:42 +0530 Subject: all: handle USE_AFTER_FREE warnings * we shouldn't be using 'local' after DHT_STACK_UNWIND() as it frees the content of local. Add a 'goto out' or similar logic to handle the situation. * fix possible overlook of unref(dict), instead of unref(xdata). * make coverity happy by re-ordering unref in meta-defaults. * gfid-access: re-order dictionary allocation so we don't have to do a extra unref. * other obvious errors reported. updates: bz#789278 Change-Id: If05961ee946b0c4868df19861d7e4a927a2a2489 Signed-off-by: Amar Tumballi --- xlators/meta/src/meta-defaults.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xlators/meta') diff --git a/xlators/meta/src/meta-defaults.c b/xlators/meta/src/meta-defaults.c index 12dc5f484b6..ea8f3230b1d 100644 --- a/xlators/meta/src/meta-defaults.c +++ b/xlators/meta/src/meta-defaults.c @@ -145,11 +145,11 @@ meta_default_readv(call_frame_t *frame, xlator_t *this, fd_t *fd, size_t size, return default_readv_failure_cbk(frame, ENOMEM); } + iov.iov_base = iobuf_ptr(iobuf); + /* iobref would have taken a ref */ iobuf_unref(iobuf); - iov.iov_base = iobuf_ptr(iobuf); - copy_offset = min(meta_fd->size, offset); copy_size = min(size, (meta_fd->size - copy_offset)); -- cgit