Fix memory leak and Delete an unnecessary file 18/104618/3 accepted/tizen/common/20161214.161050 accepted/tizen/ivi/20161215.074610 accepted/tizen/mobile/20161215.074541 accepted/tizen/tv/20161215.074554 accepted/tizen/wearable/20161215.074603 submit/tizen/20161214.100458 submit/tizen/20161214.115248 submit/tizen/20161215.045536
authorsooyeon.kim <sooyeon.kim@samsung.com>
Wed, 14 Dec 2016 01:34:24 +0000 (10:34 +0900)
committerSooyeon Kim <sooyeon.kim@samsung.com>
Wed, 14 Dec 2016 06:33:26 +0000 (22:33 -0800)
Change-Id: I7037f7e91c98b2a0b9f75c6159778cde1fe256da
Signed-off-by: sooyeon.kim <sooyeon.kim@samsung.com>
common/stt_config_parser.c
server/sttd_main.c [deleted file]

index 50de74c..7221d3b 100644 (file)
@@ -942,6 +942,7 @@ int stt_parser_get_time_info(GSList** time_list)
                        key = xmlGetProp(cur, (const xmlChar*)STT_TAG_TIME_COUNT);
                        if (NULL == key) {
                                SLOG(LOG_ERROR, stt_tag(), "[ERROR] <%s> has no content", STT_TAG_TIME_COUNT);
+                               xmlFreeDoc(doc);
                                return -1;
                        }
 
@@ -970,6 +971,7 @@ int stt_parser_get_time_info(GSList** time_list)
 
                                if (NULL == temp_info) {
                                        SLOG(LOG_ERROR, stt_tag(), "[ERROR] Memory alloc error!!");
+                                       xmlFreeDoc(doc);
                                        return -1;
                                }
 
diff --git a/server/sttd_main.c b/server/sttd_main.c
deleted file mode 100644 (file)
index 6160f9f..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
-*  Copyright (c) 2011-2016 Samsung Electronics Co., Ltd All Rights Reserved
-*  Licensed under the Apache License, Version 2.0 (the "License");
-*  you may not use this file except in compliance with the License.
-*  You may obtain a copy of the License at
-*  http://www.apache.org/licenses/LICENSE-2.0
-*  Unless required by applicable law or agreed to in writing, software
-*  distributed under the License is distributed on an "AS IS" BASIS,
-*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-*  See the License for the specific language governing permissions and
-*  limitations under the License.
-*/
-
-#include <Ecore.h>
-
-#include "stt_defs.h"
-#include "stt_network.h"
-#include "sttd_dbus.h"
-#include "sttd_main.h"
-#include "sttd_server.h"
-
-
-#define CLIENT_CLEAN_UP_TIME 500
-
-static Ecore_Timer* g_check_client_timer = NULL;
-
-int main(int argc, char** argv)
-{
-       SLOG(LOG_DEBUG, TAG_STTD, "  ");
-       SLOG(LOG_DEBUG, TAG_STTD, "  ");
-       SLOG(LOG_DEBUG, TAG_STTD, "===== STT Daemon Initialize");
-
-       if (!ecore_init()) {
-               SLOG(LOG_ERROR, TAG_STTD, "[ERROR] Fail to initialize Ecore");
-               return EXIT_FAILURE;
-       }
-
-       if (0 != sttd_dbus_open_connection()) {
-               SLOG(LOG_ERROR, TAG_STTD, "[ERROR] Fail to open connection");
-               return EXIT_FAILURE;
-       }
-
-       if (0 != sttd_initialize()) {
-               SLOG(LOG_ERROR, TAG_STTD, "[ERROR] Fail to initialize stt-daemon");
-               return EXIT_FAILURE;
-       }
-
-       stt_network_initialize();
-
-       g_check_client_timer = ecore_timer_add(CLIENT_CLEAN_UP_TIME, sttd_cleanup_client, NULL);
-       if (NULL == g_check_client_timer) {
-               SLOG(LOG_WARN, TAG_STTD, "[Main Warning] Fail to create timer of client check");
-       }
-
-       SLOG(LOG_DEBUG, TAG_STTD, "[Main] stt-daemon start...");
-
-       SLOG(LOG_DEBUG, TAG_STTD, "=====");
-       SLOG(LOG_DEBUG, TAG_STTD, "  ");
-       SLOG(LOG_DEBUG, TAG_STTD, "  ");
-
-       ecore_main_loop_begin();
-
-       SLOG(LOG_DEBUG, TAG_STTD, "===== STT Daemon Finalize");
-
-       if (NULL != g_check_client_timer) {
-               ecore_timer_del(g_check_client_timer);
-       }
-
-       sttd_dbus_close_connection();
-
-       stt_network_finalize();
-
-       sttd_finalize();
-
-       ecore_shutdown();
-
-       SLOG(LOG_DEBUG, TAG_STTD, "=====");
-       SLOG(LOG_DEBUG, TAG_STTD, "  ");
-       SLOG(LOG_DEBUG, TAG_STTD, "  ");
-
-       return 0;
-}
-
-
-