/*
-* Copyright (c) 2011-2014 Samsung Electronics Co., Ltd All Rights Reserved
+* 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
{
if (NULL != g_config_doc) xmlFreeDoc(g_config_doc);
if (NULL != config_info) {
- if (NULL != config_info->engine_id) free(config_info->engine_id);
- if (NULL != config_info->setting) free(config_info->setting);
- if (NULL != config_info->language) free(config_info->language);
+ if (NULL != config_info->engine_id) {
+ free(config_info->engine_id);
+ config_info->engine_id = NULL;
+ }
+ if (NULL != config_info->setting) {
+ free(config_info->setting);
+ config_info->setting = NULL;
+ }
+ if (NULL != config_info->language) {
+ free(config_info->language);
+ config_info->language = NULL;
+ }
free(config_info);
}
return 0;
}
+void __stt_parser_time_info_free(void* data)
+{
+ stt_result_time_info_s* time_info = (stt_result_time_info_s*)data;
+
+ if (NULL != time_info) {
+ if (NULL != time_info->text) {
+ free(time_info->text);
+ time_info->text = NULL;
+ }
+
+ free(time_info);
+ }
+}
+
int stt_parser_get_time_info(GSList** time_list)
{
if (NULL == 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);
+
+ if (NULL != temp_time_list) {
+ g_slist_free_full(temp_time_list, __stt_parser_time_info_free);
+ temp_time_list = NULL;
+ }
+ xmlFreeDoc(doc);
return -1;
}
if (NULL == temp_info) {
SLOG(LOG_ERROR, stt_tag(), "[ERROR] Memory alloc error!!");
+
+ if (NULL != temp_time_list) {
+ g_slist_free_full(temp_time_list, __stt_parser_time_info_free);
+ temp_time_list = NULL;
+ }
+ xmlFreeDoc(doc);
return -1;
}