diff options
author | Ildar Kamaletdinov <i.kamaletdinov@omp.ru> | 2022-05-07 20:35:02 +0300 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2022-05-09 13:05:38 -0700 |
commit | efa90050937c5eabc6c70a466bd886f164388484 (patch) | |
tree | 4835f6d9d6208aab78f0078d80f1d4ca61606826 /tools/hciconfig.c | |
parent | f0106d92a1e04950a1ddd28fbcdb480cbd050d43 (diff) | |
download | bluez-efa90050937c5eabc6c70a466bd886f164388484.tar.gz |
tools: Fix memory leak in hciconfig
printf() was using function that return dynamic allocated memory as
a parameter.
Found by Linux Verification Center (linuxtesting.org) with the SVACE
static analysis tool.
Diffstat (limited to 'tools/hciconfig.c')
-rw-r--r-- | tools/hciconfig.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tools/hciconfig.c b/tools/hciconfig.c index e4d521583..a1c615bfa 100644 --- a/tools/hciconfig.c +++ b/tools/hciconfig.c @@ -80,7 +80,11 @@ static void print_pkt_type(struct hci_dev_info *di) static void print_link_policy(struct hci_dev_info *di) { - printf("\tLink policy: %s\n", hci_lptostr(di->link_policy)); + char *str; + + str = hci_lptostr(di->link_policy); + printf("\tLink policy: %s\n", str); + bt_free(str); } static void print_link_mode(struct hci_dev_info *di) |