diff options
author | Amar Tumballi <amarts@redhat.com> | 2019-05-17 11:04:45 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2019-06-03 04:00:39 +0000 |
commit | 899b2170945c6023b0037fed70b19aa3cc680a22 (patch) | |
tree | a276a2c5668c6301f6c8f9f279da281ddc38b347 /xlators/nfs/server | |
parent | 950726dfc8e3171bef625b563c0c6dbba1ec2928 (diff) |
across: coverity fixes
* locks/posix.c: key was not freed in one of the cases.
* locks/common.c: lock was being free'd out of context.
* nfs/exports: handle case of missing free.
* protocol/client: handle case of entry not freed.
* storage/posix: handle possible case of double free
CID: 1398628, 1400731, 1400732, 1400756, 1124796, 1325526
updates: bz#789278
Change-Id: Ieeaca890288bc4686355f6565f853dc8911344e8
Signed-off-by: Amar Tumballi <amarts@redhat.com>
Signed-off-by: Sheetal Pamecha <spamecha@redhat.com>
Diffstat (limited to 'xlators/nfs/server')
-rw-r--r-- | xlators/nfs/server/src/exports.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xlators/nfs/server/src/exports.c b/xlators/nfs/server/src/exports.c index c62e2d9a625..d7e39934851 100644 --- a/xlators/nfs/server/src/exports.c +++ b/xlators/nfs/server/src/exports.c @@ -647,6 +647,7 @@ __exp_line_opt_parse(const char *opt_str, struct export_options **exp_opts) if (!opts) { ret = -ENOMEM; parser_unset_string(options_parser); + GF_FREE(strmatch); goto out; } } @@ -677,7 +678,7 @@ __exp_line_opt_parse(const char *opt_str, struct export_options **exp_opts) _export_options_deinit(opts); goto out; } - } else + } else { /* Cannot change to gf_msg. * gf_msg not giving output to STDOUT * Bug id : BZ1215017 @@ -686,6 +687,7 @@ __exp_line_opt_parse(const char *opt_str, struct export_options **exp_opts) "Could not find any valid options for " "string: %s", strmatch); + } GF_FREE(strmatch); } @@ -1448,7 +1450,7 @@ exp_file_parse(const char *filepath, struct exports_file **expfile, GF_CHECK_ALLOC_AND_LOG(GF_EXP, file, ret, "Allocation error while " "allocating file struct", - parse_done); + free_and_done); file->filename = gf_strdup(filepath); GF_CHECK_ALLOC_AND_LOG(GF_EXP, file, ret, @@ -1470,7 +1472,8 @@ exp_file_parse(const char *filepath, struct exports_file **expfile, goto parse_done; free_and_done: - exp_file_deinit(file); + if (file) + exp_file_deinit(file); _export_dir_deinit(expdir); parse_done: |