diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2014-11-20 15:13:15 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2014-11-27 14:57:45 +0200 |
commit | f414b4571d04554bc551e0f044ada23b68a7b52e (patch) | |
tree | 65d3430f24e35d0730b2258b42bf4e0e0995f792 /tools/btgatt-client.c | |
parent | d393274dded3f54394caa13f7ce27b2adbf8683f (diff) | |
download | bluez-f414b4571d04554bc551e0f044ada23b68a7b52e.tar.gz |
tools/gatt: Fix memory leak
Fixes following clang warning:
...
tools/btgatt-client.c:451:4: warning: Potential leak of memory pointed
to by 'value'
printf("Invalid value byte: %s\n", argv[i]);
^~~~~~
...
Diffstat (limited to 'tools/btgatt-client.c')
-rw-r--r-- | tools/btgatt-client.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/tools/btgatt-client.c b/tools/btgatt-client.c index ca84780d3..dadfa374d 100644 --- a/tools/btgatt-client.c +++ b/tools/btgatt-client.c @@ -449,6 +449,7 @@ static void cmd_read_multiple(struct client *cli, char *cmd_str) value[i] = strtol(argv[i], &endptr, 0); if (endptr == argv[i] || *endptr != '\0' || !value[i]) { printf("Invalid value byte: %s\n", argv[i]); + free(value); return; } } |