diff mbox series

[BlueZ,1/4] tools: Fix memory leak in hciconfig

Message ID 20220507173505.31249-2-i.kamaletdinov@omp.ru
State Superseded
Headers show
Series Fix few more bugs found by SVACE | expand

Commit Message

Ildar Kamaletdinov May 7, 2022, 5:35 p.m. UTC
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.
---
 tools/hciconfig.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

bluez.test.bot@gmail.com May 7, 2022, 8:16 p.m. UTC | #1
This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list.
This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=639429

---Test result---

Test Summary:
CheckPatch                    PASS      5.75 seconds
GitLint                       PASS      4.05 seconds
Prep - Setup ELL              PASS      45.04 seconds
Build - Prep                  PASS      0.68 seconds
Build - Configure             PASS      8.92 seconds
Build - Make                  PASS      1359.48 seconds
Make Check                    PASS      11.38 seconds
Make Check w/Valgrind         PASS      460.06 seconds
Make Distcheck                PASS      246.02 seconds
Build w/ext ELL - Configure   PASS      8.85 seconds
Build w/ext ELL - Make        PASS      1354.51 seconds
Incremental Build with patchesPASS      5536.54 seconds



---
Regards,
Linux Bluetooth
diff mbox series

Patch

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)