Fix memory leak and Delete an unnecessary file
[platform/core/uifw/stt.git] / common / stt_config_parser.c
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;
                                }