/*
-* 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
}
g_client_info = (stt_file_client_s*)calloc(1, sizeof(stt_file_client_s));
+ if (!g_client_info) {
+ SLOG(LOG_ERROR, TAG_STTFC, "[ERROR] Fail to allocate memory");
+ return STT_FILE_ERROR_OUT_OF_MEMORY;
+ }
/* initialize client data */
g_client_info->recognition_result_cb = NULL;
g_client_info->current_engine_id = -1;
g_client_info->time_info = NULL;
-
+
g_client_info->before_state = STT_FILE_STATE_READY;
g_client_info->current_state = STT_FILE_STATE_READY;
g_client_info->cb_ref_count = 0;
- return 0;
+ return 0;
}
int stt_file_client_destroy()
while (0 != g_client_info->cb_ref_count) {
/* wait for release callback function */
}
-
+
free(g_client_info);
g_client_info = NULL;