From c6763c80d75a62c96aaccf7a3c6f5fadf1500f58 Mon Sep 17 00:00:00 2001 From: chakradhar Date: Thu, 13 Aug 2020 16:58:16 +0530 Subject: [PATCH] static analysis memory leak fix Change-Id: I66ac7b3275a37b01e6d20946cd5814c785aae6ec --- location/manager/location.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/location/manager/location.c b/location/manager/location.c index c201883..f6bff5d 100644 --- a/location/manager/location.c +++ b/location/manager/location.c @@ -322,9 +322,11 @@ location_enable_method(const LocationMethod method, const int enable) g_free(_key); return LOCATION_ERROR_NOT_ALLOWED; } + g_free(_key); } else { int i = 0; int enabled_state = 0; + g_free(_key); for (i = LOCATION_METHOD_GPS; i < LOCATION_METHOD_MAX; i++) { _key = __convert_setting_key(i); -- 2.7.4