Added out-of-memory error code.
Change-Id: I3efc6f1dd82b81f4d05646e36325bb5f5d9330b0
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
typedef enum {
UAM_ERROR_NONE = TIZEN_ERROR_NONE, /**< Succsssful */
UAM_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+ UAM_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
UAM_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
UAM_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< Time out */
UAM_ERROR_NOW_IN_PROGRESS = TIZEN_ERROR_NOW_IN_PROGRESS, /**< Now in progress */
Name: ua-manager
Summary: User awareness manager
-Version: 0.6.0
+Version: 0.6.1
Release: 1
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
/* CHECK: List all enum values here */
CASE_TO_STR(UAM_ERROR_NONE)
CASE_TO_STR(UAM_ERROR_INVALID_PARAMETER)
+ CASE_TO_STR(UAM_ERROR_OUT_OF_MEMORY)
CASE_TO_STR(UAM_ERROR_PERMISSION_DENIED)
CASE_TO_STR(UAM_ERROR_TIMED_OUT)
CASE_TO_STR(UAM_ERROR_NOW_IN_PROGRESS)
}
app = g_malloc0(sizeof(uam_app_info_s));
+ if (!app) {
+ UAM_ERR("Failed allocated memory");
+ return UAM_ERROR_OUT_OF_MEMORY;
+ }
app->sender = g_strdup(sender);
+ if (!app->sender) {
+ UAM_ERR("Failed allocated memory");
+ return UAM_ERROR_OUT_OF_MEMORY;
+ }
g_strlcpy(app->app_id, app_info.app_id, UAM_APP_ID_MAX_STRING_LEN);
app->uid = app_info.uid;
void *buf = NULL;
buf = (void *)g_variant_get_data(in_param);
- memcpy(value, buf, size);
+ memcpy(value, buf, sizeof(memcpy) >= size ? sizeof(value) : size);
FUNC_EXIT;
}
_uam_manager_request_to_str(function), function);
info = g_malloc0(sizeof(uam_request_context_t));
+ if (!info) {
+ UAM_ERR("Failed to allocated memory [%s][%d]", sender, function);
+ return;
+ }
info->context = context;
info->result = result;
info->sender = g_strdup(sender);
+ if (!info->sender) {
+ g_free(info);
+ info = NULL;
+ UAM_ERR("Failed to allocated memory [%s][%d]", sender, function);
+ return;
+ }
info->function = function;
info->data = data;
request_list = g_slist_append(request_list, info);