{
int ret;
notification_h noti;
- notification_op *noti_op;
+ notification_op *noti_op = NULL;
GVariant *body = NULL;
uid_t uid;
/* Enable changed cb */
noti_op = _ipc_create_op(NOTIFICATION_OP_INSERT, 1, &(noti->priv_id), 1, ¬i);
ret = notification_get_uid(noti, &uid);
- if (noti_op != NULL && ret == NOTIFICATION_ERROR_NONE) {
+ if (noti_op != NULL && ret == NOTIFICATION_ERROR_NONE)
notification_call_changed_cb_for_uid(noti_op, 1, uid);
- free(noti_op);
- }
}
g_variant_unref(body);
notification_free(noti);
+ if (noti_op)
+ free(noti_op);
}
/* LCOV_EXCL_STOP */
{
int ret;
notification_h noti;
- notification_op *noti_op;
+ notification_op *noti_op = NULL;
GVariant *body = NULL;
uid_t uid;
noti_op = _ipc_create_op(NOTIFICATION_OP_UPDATE, 1, &(noti->priv_id), 1, ¬i);
ret = notification_get_uid(noti, &uid);
- if (noti_op != NULL && ret == NOTIFICATION_ERROR_NONE) {
+ if (noti_op != NULL && ret == NOTIFICATION_ERROR_NONE)
notification_call_changed_cb_for_uid(noti_op, 1, uid);
- free(noti_op);
- }
g_variant_unref(body);
notification_free(noti);
+ if (noti_op)
+ free(noti_op);
}
/* LCOV_EXCL_STOP */
private_sharing_req *handle = NULL;
GList *iter, *tmp;
target_app_info_s *target_info;
- char *app_info;
+ char *app_info = NULL;
iter = target_app_list;
for (; iter != NULL; iter = g_list_next(iter)) {
app_info = strdup(target_info->app_id);
if (app_info == NULL) {
ERR("out of memory");
+ ret = NOTIFICATION_ERROR_OUT_OF_MEMORY;
goto out;
}
}
out:
+ if (ret != NOTIFICATION_ERROR_NONE && app_info)
+ free(app_info);
+
if (handle != NULL)
security_manager_private_sharing_req_free(handle);
if (path_array != NULL)
uid_t uid)
{
int ret = NOTIFICATION_ERROR_NONE;
- char *shared_dir;
bool is_overlapping = false;
sharing_req_data_s *req_data;
sharing_file_info_s *file_info, *dup_file_info;
if (noti == NULL || noti->caller_app_id == NULL)
return NOTIFICATION_ERROR_INVALID_PARAMETER;
- shared_dir = __get_shared_dir(noti);
- if (shared_dir == NULL)
- return NOTIFICATION_ERROR_NONE;
-
tmp = g_list_find_custom(__uid_list, GINT_TO_POINTER(uid),
__comp_uid_info_list);
if (tmp == NULL) {
__OOM_CHECK(req_data->app_id, NOTIFICATION_ERROR_OUT_OF_MEMORY,
__free_req_info(req_data));
- req_data->dir = strdup(shared_dir);
+ req_data->dir = __get_shared_dir(noti);
__OOM_CHECK(req_data->dir, NOTIFICATION_ERROR_OUT_OF_MEMORY,
__free_req_info(req_data));
req_data = (sharing_req_data_s *)req_list->data;
}
- __make_sharing_dir(shared_dir);
- free(shared_dir);
+ __make_sharing_dir(req_data->dir);
tmp = g_list_find_custom(req_data->priv_id_list,
GINT_TO_POINTER(noti->priv_id), __comp_priv_id);