diff options
author | Bhumika Goyal <bgoyal@redhat.com> | 2018-08-16 21:32:21 +0530 |
---|---|---|
committer | Amar Tumballi <amarts@redhat.com> | 2018-08-18 05:49:41 +0000 |
commit | 41e768f65bf63c9da22f7125e1eeb77d9c775352 (patch) | |
tree | e5d00b8c24061bda7971f76cc778d0e268011d29 /xlators/storage | |
parent | d975305ab1c764582bf63bc6f526a2739e2b34eb (diff) |
block xlator: fix some coverity issues
Fixes CID: 1128916, 1128917, 1128919, 1192875
Change-Id: I5276b7db4a9650e70c335e25b9b4609a887233c0
updates: bz#789278
Signed-off-by: Bhumika Goyal <bgoyal@redhat.com>
Diffstat (limited to 'xlators/storage')
-rw-r--r-- | xlators/storage/bd/src/bd-helper.c | 1 | ||||
-rw-r--r-- | xlators/storage/bd/src/bd.c | 6 |
2 files changed, 6 insertions, 1 deletions
diff --git a/xlators/storage/bd/src/bd-helper.c b/xlators/storage/bd/src/bd-helper.c index 419df784585..ee108b8eda6 100644 --- a/xlators/storage/bd/src/bd-helper.c +++ b/xlators/storage/bd/src/bd-helper.c @@ -342,6 +342,7 @@ bd_validate_bd_xattr (xlator_t *this, char *bd, char **type, if (sys_stat (path, &stbuf)) { gf_log (this->name, GF_LOG_WARNING, "lstat failed for path %s", path); + GF_FREE (path); return -1; } diff --git a/xlators/storage/bd/src/bd.c b/xlators/storage/bd/src/bd.c index e37bfeaf83b..ade12d9092f 100644 --- a/xlators/storage/bd/src/bd.c +++ b/xlators/storage/bd/src/bd.c @@ -683,6 +683,7 @@ posix: STACK_WIND (frame, bd_open_cbk, FIRST_CHILD(this), FIRST_CHILD(this)->fops->open, loc, flags, fd, xdata); + GF_FREE (devpath); return 0; out: BD_STACK_UNWIND (open, frame, -1, ret, fd, NULL); @@ -1585,6 +1586,7 @@ revert_xattr: /* revert setxattr */ op_ret = dict_get_str (local->dict, BD_XATTR, &bd); GF_FREE (bd); + bd = NULL; if (bdatt) gf_asprintf (&bd, "%s:%ld", bdatt->type, bdatt->iatt.ia_size); @@ -1599,6 +1601,8 @@ revert_xattr: FIRST_CHILD(this)->fops->setxattr, &local->loc, local->dict, 0, NULL); + if (bd) + GF_FREE (bd); return 0; out: if (local->fd) @@ -1957,7 +1961,7 @@ bd_setattr (call_frame_t *frame, xlator_t *this, loc_t *loc, struct iatt *stbuf, STACK_WIND_COOKIE (frame, bd_setattr_cbk, ck_valid, FIRST_CHILD(this), FIRST_CHILD(this)->fops->setattr, loc, stbuf, valid, xdata); - + GF_FREE (ck_valid); return 0; out: BD_STACK_UNWIND (setattr, frame, -1, ENOMEM, NULL, NULL, xdata); |