2014-09-22 12:14:50

by Andrei Emeltchenko

[permalink] [raw]
Subject: [PATCH] tools: Destroy client on error

From: Andrei Emeltchenko <[email protected]>

---
tools/btgatt-client.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/tools/btgatt-client.c b/tools/btgatt-client.c
index 41b85ad..021000d 100644
--- a/tools/btgatt-client.c
+++ b/tools/btgatt-client.c
@@ -1124,6 +1124,7 @@ int main(int argc, char *argv[])
EPOLLIN | EPOLLRDHUP | EPOLLHUP | EPOLLERR,
prompt_read_cb, cli, NULL) < 0) {
fprintf(stderr, "Failed to initialize console\n");
+ client_destroy(cli);
return EXIT_FAILURE;
}

--
1.9.1