diff options
author | Andrei Emeltchenko <andrei.emeltchenko@intel.com> | 2014-10-02 17:31:37 +0300 |
---|---|---|
committer | Szymon Janc <szymon.janc@tieto.com> | 2014-10-02 16:36:04 +0200 |
commit | ba0392f809cbb857546f891bc40b98c11e718e94 (patch) | |
tree | dbbf40122b0d145155c7ee18b8e59023fcc560b6 /android/main.c | |
parent | f65994ef319683aa4e0c454b511c17378567f5b6 (diff) | |
download | bluez-ba0392f809cbb857546f891bc40b98c11e718e94.tar.gz |
android/core: Fix memory leak in parse_system_id()
get_prop() allocates memory which needs to be freed.
Diffstat (limited to 'android/main.c')
-rw-r--r-- | android/main.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/android/main.c b/android/main.c index 4f3a6bf8b..703b3b698 100644 --- a/android/main.c +++ b/android/main.c @@ -382,9 +382,11 @@ static void parse_system_id(uint16_t len, const uint8_t *val) res = strtoull(id, NULL, 16); if (res == ULLONG_MAX && errno == ERANGE) - return; + goto done; config_system_id = res; +done: + free(id); } static void configuration(const void *buf, uint16_t len) |