diff options
author | Xie Changlong <xiechanglong@cmss.chinamobile.com> | 2020-01-06 10:11:32 +0800 |
---|---|---|
committer | Amar Tumballi <amarts@gmail.com> | 2020-01-06 07:44:06 +0000 |
commit | 063bfe949eb11b33424bd67dd4225bb430ceaae7 (patch) | |
tree | 057b0fdd2b41ea5898dbad49722ecebc4f8de5f0 | |
parent | f805eb110081783690d29ffe2d80405a9ba6191c (diff) |
lock: fix Coverity CID 1412107
To avoid memory leak.
Change-Id: Ib802be310fe989223afd623d3e5a9c9016d4fd38
updates: bz#789278
Signed-off-by: Xie Changlong <xiechanglong@cmss.chinamobile.com>
-rw-r--r-- | xlators/features/locks/src/posix.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c index 8bbcef6385a..af530aafd84 100644 --- a/xlators/features/locks/src/posix.c +++ b/xlators/features/locks/src/posix.c @@ -473,6 +473,8 @@ pl_inodelk_xattr_fill_multiple(dict_t *this, char *key, data_t *value, tmp_key = gf_strdup(key); strtok_r(tmp_key, ":", &save_ptr); if (!*save_ptr) { + if (tmp_key) + GF_FREE(tmp_key); gf_msg(THIS->name, GF_LOG_ERROR, 0, EINVAL, "Could not tokenize domain string from key %s", key); return -1; |