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 /test/hciemu.c | |
parent | 78ed16f407a0067e5eac2879fa17c31237c088da (diff) |
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 'test/hciemu.c')
-rw-r--r-- | test/hciemu.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/hciemu.c b/test/hciemu.c index ba9b89dbd..522776654 100644 --- a/test/hciemu.c +++ b/test/hciemu.c @@ -499,8 +499,11 @@ static void accept_connection(uint8_t *data) static void close_connection(struct vhci_conn *conn) { + char addr[18]; + + ba2str(&conn->dest, addr); syslog(LOG_INFO, "Closing connection %s handle %d", - batostr(&conn->dest), conn->handle); + addr, conn->handle); g_io_channel_shutdown(conn->chan, TRUE, NULL); g_io_channel_unref(conn->chan); |