{
DEBUG_EMUL_BEGIN();
- if (Snep_Server_msg->data->buffer != NULL)
+ if (Snep_Server_msg != NULL)
{
- free(Snep_Server_msg->data->buffer);
- Snep_Server_msg->data->buffer = NULL;
- }
+ if (Snep_Server_msg->data != NULL)
+ {
- if (Snep_Server_msg->data != NULL)
- {
- free(Snep_Server_msg->data);
- Snep_Server_msg->data = NULL;
- }
+ if (Snep_Server_msg->data->buffer != NULL)
+ {
+ free(Snep_Server_msg->data->buffer);
+ Snep_Server_msg->data->buffer = NULL;
+ }
+
+ free(Snep_Server_msg->data);
+ Snep_Server_msg->data = NULL;
+ }
- if(Snep_Server_msg != NULL)
- {
free(Snep_Server_msg);
Snep_Server_msg = NULL;
}
if((emulMsg_poll_fd = epoll_create1(EPOLL_CLOEXEC)) == -1)
{
DEBUG_MSG("epoll_create1 is occured");
+ close(emulMsg_file_fd);
+ return;
}
if((emulMsg_poll_events = (struct epoll_event *)calloc(1, sizeof(struct epoll_event) * EPOLL_SIZE)) == NULL)
{
DEBUG_MSG("calloc is occured");
+ close(emulMsg_file_fd);
+ return;
}
/* set event */