diff options
author | Tedd Ho-Jeong An <tedd.an@intel.com> | 2021-10-18 10:28:30 -0700 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2021-10-18 15:31:55 -0700 |
commit | cd75918d2176e8978e1808f3fe67151c4e974437 (patch) | |
tree | 0bb8121e066447f3cc674000eee225c034bec373 /profiles | |
parent | 4ad622d592ba552b8c61797594b09fa268af140d (diff) | |
download | bluez-cd75918d2176e8978e1808f3fe67151c4e974437.tar.gz |
profiles/input: Fix unchecked return value
This patch fixes the unchecked return value(CWE-252) issues reported by
the Coverity.
Diffstat (limited to 'profiles')
-rw-r--r-- | profiles/input/device.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/profiles/input/device.c b/profiles/input/device.c index 50ae51855..013899211 100644 --- a/profiles/input/device.c +++ b/profiles/input/device.c @@ -1050,7 +1050,11 @@ static int hidp_add_connection(struct input_device *idev) sprintf(handle, "0x%8.8X", idev->handle); key_file = g_key_file_new(); - g_key_file_load_from_file(key_file, filename, 0, NULL); + if (!g_key_file_load_from_file(key_file, filename, 0, &gerr)) { + error("Unable to load key file from %s: (%s)", filename, + gerr->message); + g_error_free(gerr); + } str = g_key_file_get_string(key_file, "ServiceRecords", handle, NULL); g_key_file_free(key_file); |