From: Yunmi Ha Date: Tue, 13 Jul 2021 02:35:15 +0000 (+0900) Subject: Change hal_common_get_backend_library_names API parameter. X-Git-Tag: accepted/tizen/unified/20210714.014127^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F76%2F261176%2F1;p=platform%2Fhal%2Fapi%2Fsensor.git Change hal_common_get_backend_library_names API parameter. Change-Id: I1bca6851b6a8b2704622ebf44fbf4bfa6b413ce5 Signed-off-by: Yunmi Ha --- diff --git a/src/hal-api-sensor.cpp b/src/hal-api-sensor.cpp index 7dbbd99..02a88b5 100644 --- a/src/hal-api-sensor.cpp +++ b/src/hal-api-sensor.cpp @@ -42,6 +42,8 @@ static std::vector hal_backend_devs; #define FREE(x) \ do { if (x) { free(x); x = NULL; } } while(0) +#define MAX_LIB_NAME 256 + EXPORT int hal_sensor_get_backend(void) { @@ -69,14 +71,14 @@ int hal_sensor_get_backend(void) } for (i = 0; i < hal_sensor_count; i++) { - hal_sensor_names[i] = (char *)malloc(sizeof(char) * 256); + hal_sensor_names[i] = (char *)malloc(sizeof(char) * MAX_LIB_NAME); if (!hal_sensor_names[i]) { _E("Failed to allocate memory."); goto FREE_MEMORY; } } - ret_getnames = hal_common_get_backend_library_names(HAL_MODULE_SENSOR, hal_sensor_names, hal_sensor_count); + ret_getnames = hal_common_get_backend_library_names(HAL_MODULE_SENSOR, hal_sensor_names, hal_sensor_count, MAX_LIB_NAME); if (ret_getnames < 0) { _E("Failed to get backend library names."); goto FREE_MEMORY;