aboutsummaryrefslogtreecommitdiff
path: root/compat/bnep.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@googlemail.com>2011-02-18 00:06:26 +0100
committerJohan Hedberg <johan.hedberg@nokia.com>2011-02-18 12:01:12 -0300
commit5408e11b6bd1ad6122a9aa407b35ee2fcfad5144 (patch)
tree0e9a72a9cd5c35ac0346e6f6253a882bc6bc72c3 /compat/bnep.c
parent78ed16f407a0067e5eac2879fa17c31237c088da (diff)
downloadbluez-5408e11b6bd1ad6122a9aa407b35ee2fcfad5144.tar.gz
Replace batostr() with ba2str() to avoid memleaks
batostr() returns dynamically allocated strings. Replace it with ba2str() wherever possible to avoid heap allocations and fix memleaks.
Diffstat (limited to 'compat/bnep.c')
-rw-r--r--compat/bnep.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/compat/bnep.c b/compat/bnep.c
index 9b0d8b8c..24bf7e34 100644
--- a/compat/bnep.c
+++ b/compat/bnep.c
@@ -137,9 +137,10 @@ int bnep_show_connections(void)
}
for (i = 0; i < req.cnum; i++) {
+ char addr[18];
+ ba2str((bdaddr_t *) ci[i].dst, addr);
printf("%s %s %s\n", ci[i].device,
- batostr((bdaddr_t *) ci[i].dst),
- bnep_svc2str(ci[i].role));
+ addr, bnep_svc2str(ci[i].role));
}
return 0;
}