summaryrefslogtreecommitdiffstats
path: root/xlators/features/gfid-access/src
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2018-12-19 09:45:42 +0530
committerAmar Tumballi <amarts@redhat.com>2018-12-20 06:26:37 +0000
commite1f92176a8d372e99386c0f007d6a38c0a54ca5b (patch)
tree4a84a104088b4e6d17a2d291230335abcdb23835 /xlators/features/gfid-access/src
parent8cde14a537f0112400744d518ed196eb8fa232f2 (diff)
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 <amarts@redhat.com>
Diffstat (limited to 'xlators/features/gfid-access/src')
-rw-r--r--xlators/features/gfid-access/src/gfid-access.c16
1 files changed, 8 insertions, 8 deletions
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;