mc_error("Failed to create queue manager");
return MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY;
}
+
_request->queue = g_queue_new();
+
if (_request->queue == NULL) {
mc_error("Failed to create new queue");
+ MC_SAFE_FREE(_request);
return MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY;
}
+
*data = _request;
+
return MEDIA_CONTROLLER_ERROR_NONE;
}
mc_error("Failed to allocate service data");
return MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY;
}
+
res = __mc_create_request_queue(&(_service_data->request));
if (res != MEDIA_CONTROLLER_ERROR_NONE) {
mc_error("Failed to create queue data");
+ MC_SAFE_FREE(_service_data);
return MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY;
}
+
*data = _service_data;
+
return MEDIA_CONTROLLER_ERROR_NONE;
}
static int _mc_service_add_connection(GList **connected_list, mc_comm_msg_s *request_msg)
{
mc_debug_fenter();
- mc_list_data_set_t *data = (mc_list_data_set_t *)calloc(1, sizeof(mc_list_data_set_t));
- if (data == NULL) {
- mc_error("memory allocation is failed");
- return MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY;
- }
+
+ mc_list_data_set_t *data = NULL;
if (*connected_list != NULL && _mc_service_is_exist_pid(*connected_list, request_msg->pid, request_msg->type)) {
mc_error("[No-error] connected but do not increase counter [%d]", g_connection_cnt);
return MEDIA_CONTROLLER_ERROR_NONE;
}
+
+ data = (mc_list_data_set_t *)calloc(1, sizeof(mc_list_data_set_t));
+ if (data == NULL) {
+ mc_error("memory allocation is failed");
+ return MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY;
+ }
+
data->pid = request_msg->pid;
data->type = request_msg->type;
*connected_list = g_list_append(*connected_list, data);
mc_debug("mc_read_service_request_tcp_socket is called!!!!!");
- req = (mc_service_request *) calloc(1, sizeof(mc_service_request));
- if (req == NULL) {
- mc_error("memory allocation is failed");
- send_msg = MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY;
- goto ERROR;
- }
-
sock = g_io_channel_unix_get_fd(src);
if (sock < 0) {
mc_error("sock fd is invalid!");
mc_peer_creds creds;
memset(&creds, 0x00, sizeof(mc_peer_creds));
+
+ req = (mc_service_request *) calloc(1, sizeof(mc_service_request));
+ if (req == NULL) {
+ mc_error("memory allocation is failed");
+ send_msg = MEDIA_CONTROLLER_ERROR_OUT_OF_MEMORY;
+ goto ERROR;
+ }
+
req->client_sock = client_sock;
ret = mc_cynara_receive_untrusted_message(req->client_sock, &recv_msg, &creds);
if (ret != MEDIA_CONTROLLER_ERROR_NONE) {
} else {
req->permission = 2;
}
- } else {
+ } else {
req->permission = 1;
}