summaryrefslogtreecommitdiff
path: root/tools/btgatt-client.c
diff options
context:
space:
mode:
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>2014-12-19 11:25:24 +0200
committerJohan Hedberg <johan.hedberg@intel.com>2015-01-09 11:44:18 +0200
commit975df07aa01a3332a82dde17f5c49d17119ecee7 (patch)
tree9738af1e15dee2fc490c2f5a28931ab24a752b64 /tools/btgatt-client.c
parent19e628877ea2b5b82f2d66cd14e9c4e2f6d3d1de (diff)
downloadbluez-975df07aa01a3332a82dde17f5c49d17119ecee7.tar.gz
tools/gatt: Fix not checking malloc() failure
This follows standard practice elsewhere in this file.
Diffstat (limited to 'tools/btgatt-client.c')
-rw-r--r--tools/btgatt-client.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/btgatt-client.c b/tools/btgatt-client.c
index e2e053742..62c4d3e7a 100644
--- a/tools/btgatt-client.c
+++ b/tools/btgatt-client.c
@@ -457,6 +457,10 @@ static void cmd_read_multiple(struct client *cli, char *cmd_str)
}
value = malloc(sizeof(uint16_t) * argc);
+ if (!value) {
+ printf("Failed to construct value\n");
+ return;
+ }
for (i = 0; i < argc; i++) {
value[i] = strtol(argv[i], &endptr, 0);