diff options
author | David Herrmann <dh.herrmann@googlemail.com> | 2011-02-18 00:06:26 +0100 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2011-02-18 12:01:12 -0300 |
commit | 5408e11b6bd1ad6122a9aa407b35ee2fcfad5144 (patch) | |
tree | 0e9a72a9cd5c35ac0346e6f6253a882bc6bc72c3 /compat/bnep.c | |
parent | 78ed16f407a0067e5eac2879fa17c31237c088da (diff) | |
download | bluez-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.c | 5 |
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; } |