[PATCH] android/core: Fix memory leak in parse_system_id()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Andrei Emeltchenko <andrei.emeltchenko@xxxxxxxxx>

get_prop() allocates memory which needs to be freed.
---
 android/main.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/android/main.c b/android/main.c
index 4f3a6bf..703b3b6 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)
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux