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/features/gfid-access/src/gfid-access.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'xlators/features/gfid-access/src') diff --git a/xlators/features/gfid-access/src/gfid-access.c b/xlators/features/gfid-access/src/gfid-access.c index 4a422ee658c..ad7776741d9 100644 --- a/xlators/features/gfid-access/src/gfid-access.c +++ b/xlators/features/gfid-access/src/gfid-access.c @@ -448,14 +448,6 @@ ga_new_entry(call_frame_t *frame, xlator_t *this, loc_t *loc, data_t *data, 0, }; - args = ga_newfile_parse_args(this, data); - if (!args) - goto out; - - ret = gf_uuid_parse(args->gfid, gfid); - if (ret) - goto out; - if (!xdata) { xdata = dict_new(); } else { @@ -467,6 +459,14 @@ ga_new_entry(call_frame_t *frame, xlator_t *this, loc_t *loc, data_t *data, goto out; } + args = ga_newfile_parse_args(this, data); + if (!args) + goto out; + + ret = gf_uuid_parse(args->gfid, gfid); + if (ret) + goto out; + ret = ga_fill_tmp_loc(loc, this, gfid, args->bname, xdata, &tmp_loc); if (ret) goto out; -- cgit