Hal allocation 19/315919/2 accepted/tizen/unified/20241015.153113
authorAbhimanyu Swami <abhimanyu1.s@samsung.com>
Fri, 9 Aug 2024 10:26:55 +0000 (15:56 +0530)
committerAbhimanyu Swami <abhimanyu1.s@samsung.com>
Tue, 13 Aug 2024 09:42:32 +0000 (15:12 +0530)
Change-Id: Ib067863f9544a01fa44258d7dedda9da9cefaf32

packaging/hal-api-location.spec
src/hal-api-location.c

index 61abe2a9176c45cb32d07abd8d176648f75a6a21..5805e4da6f3de0e7ae6ac446f336c15b7198b2ad 100644 (file)
@@ -5,7 +5,7 @@
 ### main package #########
 Name:       %{name}
 Summary:    %{name} interface
-Version:    0.0.1
+Version:    0.0.2
 Release:    1
 Group:      Development/Libraries
 License:    Apache-2.0
index 7436d0c972c31d12cbc24199b098eea6a7e3b3c6..f20f8a38574ac2d62abb9a06dfa65a51d16c753b 100644 (file)
@@ -39,10 +39,16 @@ int hal_location_get_backend(void)
        if (g_hal_location_funcs)
                return 0;
 
+       g_hal_location_funcs = calloc(1, sizeof(hal_backend_location_funcs));
+       if (!g_hal_location_funcs)
+               return -ENOMEM;
+
        ret = hal_common_get_backend(HAL_MODULE_LOCATION, (void **)&g_hal_location_funcs);
        if (ret < 0) {
+               free(g_hal_location_funcs);
+               g_hal_location_funcs = NULL;
                _E("Failed to get backend\n");
-               return -EINVAL;
+               return -ENOTSUP;
        }
 
        return 0;
@@ -59,8 +65,10 @@ int hal_location_put_backend(void)
        ret = hal_common_put_backend(HAL_MODULE_LOCATION, (void *)g_hal_location_funcs);
        if (ret < 0) {
                _E("Failed to put backend\n");
-               return -EINVAL;
+               return ret;
        }
+
+       free(g_hal_location_funcs);
        g_hal_location_funcs = NULL;
 
        return 0;