summaryrefslogtreecommitdiffstats
path: root/tools/hcitool.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-08-05 07:34:55 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-08-05 07:34:55 +0000
commitad3049f07e580ee1ffb235afea1e368c4c46a639 (patch)
tree072e4823da238dc5fc94b90c40e328ef43a612e0 /tools/hcitool.c
parent6bba8994c83cb007356c0b358bdc5dda9bdff59a (diff)
Use bt_free() to free the memory allocated by lmp_featurestostr()
Diffstat (limited to 'tools/hcitool.c')
-rw-r--r--tools/hcitool.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/tools/hcitool.c b/tools/hcitool.c
index ba8ba823..bc09ea07 100644
--- a/tools/hcitool.c
+++ b/tools/hcitool.c
@@ -379,7 +379,8 @@ static void cmd_inq(int dev_id, int argc, char **argv)
(info+i)->dev_class[1],
(info+i)->dev_class[0]);
}
- free(info);
+
+ bt_free(info);
}
/* Device scanning */
@@ -603,13 +604,15 @@ static void cmd_scan(int dev_id, int argc, char **argv)
}
if (hci_read_remote_features(dd, handle, features, 20000) == 0) {
+ char *tmp = lmp_featurestostr(features, "\t\t", 63);
printf("LMP features:\t0x%2.2x 0x%2.2x 0x%2.2x 0x%2.2x"
" 0x%2.2x 0x%2.2x 0x%2.2x 0x%2.2x\n",
features[0], features[1],
features[2], features[3],
features[4], features[5],
features[6], features[7]);
- printf("%s\n", lmp_featurestostr(features, "\t\t", 63));
+ printf("%s\n", tmp);
+ bt_free(tmp);
}
if (cc) {
@@ -622,7 +625,7 @@ static void cmd_scan(int dev_id, int argc, char **argv)
}
close(dd);
- free(info);
+ bt_free(info);
}
/* Remote name */
@@ -786,10 +789,11 @@ static void cmd_info(int dev_id, int argc, char **argv)
}
if (hci_read_remote_features(dd, handle, features, 20000) == 0) {
+ char *tmp = lmp_featurestostr(features, "\t\t", 63);
printf("\tFeatures: 0x%2.2x 0x%2.2x 0x%2.2x 0x%2.2x 0x%2.2x 0x%2.2x 0x%2.2x 0x%2.2x\n%s\n",
features[0], features[1], features[2], features[3],
- features[4], features[5], features[6], features[7],
- lmp_featurestostr(features, "\t\t", 63));
+ features[4], features[5], features[6], features[7], tmp);
+ bt_free(tmp);
}
if (features[7] & LMP_EXT_FEAT) {