[location-manager] Memory Leak fix 73/322273/1 accepted/tizen_9.0_unified tizen_9.0 accepted/tizen/9.0/unified/20250410.163717
authorPriya Kohli <priya.kohli@samsung.com>
Tue, 12 Nov 2024 10:38:28 +0000 (16:08 +0530)
committerAbhimanyu Swami <abhimanyu1.s@samsung.com>
Mon, 7 Apr 2025 06:29:23 +0000 (11:59 +0530)
Change-Id: I810cd07dfb1aa0b8892a1247c7c9d9769e08e56e
Signed-off-by: Priya Kohli <priya.kohli@samsung.com>
src/locations.c

index 62cae97a74c2b47c9c271a72a2f8fc7023998d92..138aec90653141fa9066154e3a2ce7ecbc0ac1b3 100755 (executable)
@@ -826,6 +826,9 @@ EXPORT_API int location_manager_get_location(location_manager_h manager, double
                return __convert_error_code(ret);       //LCOV_EXCL_LINE
 
        if (pos->status == LOCATION_STATUS_NO_FIX) {
+               location_position_free(pos);
+               location_velocity_free(vel);
+               location_accuracy_free(acc);
                return __convert_error_code(LOCATION_ERROR_NOT_AVAILABLE);      //LCOV_EXCL_LINE
        } else {
                *latitude = pos->latitude;