diff options
author | Gopal Tiwari <gtiwari@redhat.com> | 2022-05-31 13:11:12 +0530 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-05-31 12:52:28 -0700 |
commit | 35cbfd9660949fca23418bfa32fd51d81ed91208 (patch) | |
tree | 986a20e756dc710745af2ba9d2a10f4a18ea185b /tools | |
parent | 4334be027ae1ad50193025c90e77a76b64464b53 (diff) | |
download | bluez-35cbfd9660949fca23418bfa32fd51d81ed91208.tar.gz |
mesh/mesh-db: Fix resource leaks
While performing static tool analysis using coverity found following
reports for resouse leak
bluez-5.64/tools/mesh/mesh-db.c:2388: leaked_handle: Handle variable
"fd" going out of scope leaks the handle.
bluez-5.64/tools/mesh/mesh-db.c:2388: leaked_storage: Variable "str"
going out of scope leaks the storage it points to.
Diffstat (limited to 'tools')
-rw-r--r-- | tools/mesh/mesh-db.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/mesh/mesh-db.c b/tools/mesh/mesh-db.c index fa11837df..896ff722c 100644 --- a/tools/mesh/mesh-db.c +++ b/tools/mesh/mesh-db.c @@ -2384,6 +2384,8 @@ bool mesh_db_load(const char *fname) sz = read(fd, str, st.st_size); if (sz != st.st_size) { + close(fd); + l_free(str); l_error("Failed to read configuration file %s", fname); return false; } |