Fix Svace issue 62/89062/1 accepted/tizen/3.0/common/20161114.105039 accepted/tizen/3.0/mobile/20161015.033950 accepted/tizen/3.0/wearable/20161015.083608 accepted/tizen/common/20160923.161245 accepted/tizen/mobile/20160927.020326 accepted/tizen/wearable/20160927.020552 submit/tizen/20160923.112826 submit/tizen_3.0_common/20161104.104000 submit/tizen_3.0_mobile/20161015.000005 submit/tizen_3.0_wearable/20161015.000004
authorJihoon Jung <jh8801.jung@samsung.com>
Thu, 22 Sep 2016 03:04:32 +0000 (12:04 +0900)
committerJihoon Jung <jh8801.jung@samsung.com>
Thu, 22 Sep 2016 03:05:09 +0000 (12:05 +0900)
Signed-off-by: Jihoon Jung <jh8801.jung@samsung.com>
Change-Id: I92fa8349ab3ffb9b7246416dc4e565c296fb3b3c

src/oem/oem_emul.c

index 22612d0..0bd94a9 100644 (file)
@@ -513,20 +513,21 @@ static void _net_nfc_deinitialize_llcp(void)
 {
        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;
        }
@@ -1655,11 +1656,15 @@ static void emul_ReaderThread(void * pArg)
        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 */