static analysis memory leak fix 01/241001/1 accepted/tizen/unified/20200814.123111 submit/tizen/20200813.113257
authorchakradhar <v.pogiri@samsung.com>
Thu, 13 Aug 2020 11:28:16 +0000 (16:58 +0530)
committerchakradhar <v.pogiri@samsung.com>
Thu, 13 Aug 2020 11:28:16 +0000 (16:58 +0530)
Change-Id: I66ac7b3275a37b01e6d20946cd5814c785aae6ec

location/manager/location.c

index c201883..f6bff5d 100644 (file)
@@ -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);