Update the code to close the value of accept() and memory leak 90/63390/1 accepted/tizen/common/20160323.185630 accepted/tizen/ivi/20160323.141248 accepted/tizen/mobile/20160323.140131 accepted/tizen/tv/20160323.140213 accepted/tizen/wearable/20160323.140054 submit/tizen/20160323.115321
authorYoungHun Kim <yh8004.kim@samsung.com>
Wed, 23 Mar 2016 11:35:13 +0000 (20:35 +0900)
committerYoungHun Kim <yh8004.kim@samsung.com>
Wed, 23 Mar 2016 11:35:16 +0000 (20:35 +0900)
Change-Id: If486a6def56a512bb57dadeb06719108fde689b7

src/muse_core.c
src/muse_core_log.c
src/muse_core_msg_json.c

index 665e4a5..56616e0 100644 (file)
@@ -255,7 +255,6 @@ static gboolean _muse_core_connection_handler(GIOChannel *source, GIOCondition c
        muse_module_h module = NULL;
        muse_core_workqueue_job_t *job = NULL;
 
-
        server_sockfd = g_io_channel_unix_get_fd(source);
 
        client_len = sizeof(client_address);
@@ -263,13 +262,9 @@ static gboolean _muse_core_connection_handler(GIOChannel *source, GIOCondition c
        LOGD("server: %d client: %d", server_sockfd, client_sockfd);
 
        if (client_sockfd < 0) {
-               LOGE("failed to accept");
-               if (errno == EWOULDBLOCK || errno == ECONNABORTED) {
-                       return FALSE;
-               } else {
-                       strerror_r(errno, err_msg, MAX_ERROR_MSG_LEN);
-                       LOGE("accept: %s\n", err_msg);
-               }
+               strerror_r(errno, err_msg, MAX_ERROR_MSG_LEN);
+               LOGE("accept: %s\n", err_msg);
+               return FALSE;
        }
 
        if (channel == MUSE_CHANNEL_MSG) {
index ac59947..86af657 100644 (file)
@@ -53,9 +53,10 @@ static void _muse_core_log_flush_msg(void);
 static void _muse_core_log_sig_abort(int signo)
 {
        char err_msg[MAX_ERROR_MSG_LEN] = {'\0',};
-       if (SIG_ERR == signal(SIGABRT, SIG_DFL))
+       if (SIG_ERR == signal(SIGABRT, SIG_DFL)) {
                strerror_r(errno, err_msg, MAX_ERROR_MSG_LEN);
                LOGE("SIGABRT handler: %s", err_msg);
+       }
 
        static char client_name[256];
        memset(client_name, '\0', sizeof(client_name));
index a7c1720..147f54a 100644 (file)
@@ -183,6 +183,7 @@ gboolean muse_core_msg_json_deserialize(
        val = _muse_core_msg_json_find_obj(jobj, key);
        if (!val) {
                LOGE("\"%s\" key is not founded", key);
+               json_object_put(jobj);
                return FALSE;
        }