Fix engine parser to access directories
[platform/core/uifw/stt.git] / client / stt_client.c
index d5a45b4..d2d04cf 100644 (file)
@@ -1,5 +1,5 @@
 /*
-*  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
@@ -68,6 +68,8 @@ int stt_client_new(stt_h* stt)
        client->error_user_data = NULL;
        client->default_lang_changed_cb = NULL;
        client->default_lang_changed_user_data = NULL;
+       client->speech_status_cb = NULL;
+       client->speech_status_user_data = NULL;
 
        client->current_engine_id = NULL;
        client->credential = NULL;
@@ -88,8 +90,12 @@ int stt_client_new(stt_h* stt)
 
        client->internal_state = STT_INTERNAL_STATE_NONE;
 
+       client->speech_status = -1;
+
        client->cb_ref_count = 0;
 
+       client->internal = false;
+
        g_client_list = g_list_append(g_client_list, client);
 
        *stt = temp;
@@ -127,14 +133,18 @@ int stt_client_destroy(stt_h stt)
 
                                if (NULL != data->err_msg) {
                                        free(data->err_msg);
+                                       data->err_msg = NULL;
                                }
 
                                if (NULL != data->credential) {
                                        free(data->credential);
+                                       data->credential = NULL;
                                }
 
                                free(data);
                                free(stt);
+                               data = NULL;
+                               stt = NULL;
 
                                return 0;
                        }