From 17f2d43a8468784fa732b676628f70aa0d44f16d Mon Sep 17 00:00:00 2001 From: "sooyeon.kim" Date: Wed, 14 Dec 2016 16:58:27 +0900 Subject: [PATCH] Fix SVACE issue Change-Id: I263287fa4dcb7f1fe0ae3624608915b0f2460b24 Signed-off-by: sooyeon.kim --- client/tts.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/client/tts.c b/client/tts.c index 09f3892..05daf46 100644 --- a/client/tts.c +++ b/client/tts.c @@ -445,7 +445,7 @@ int tts_set_server_tts(tts_h tts, const char* credential) return TTS_ERROR_NOT_SUPPORTED; } - if (NULL == tts || NULL == credential) { + if (NULL == tts) { SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Input parameter is null"); return TTS_ERROR_INVALID_PARAMETER; } @@ -467,19 +467,20 @@ int tts_set_server_tts(tts_h tts, const char* credential) client->credential = NULL; } - client->credential = strdup(credential); - if (NULL == client->credential) { - SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to allocate memory"); - return TTS_ERROR_OUT_OF_MEMORY; - } - client->internal = true; char* key = NULL; - if (NULL != credential) + if (NULL != credential) { key = strdup("EnableServerTTS"); - else + client->credential = strdup(credential); + if (NULL == client->credential) { + SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to allocate memory"); + return TTS_ERROR_OUT_OF_MEMORY; + } + } else { key = strdup("DisableServerTTS"); + } + if (NULL == key) { SLOG(LOG_ERROR, TAG_TTSC, "[ERROR] Fail to allocate memory"); return TTS_ERROR_OUT_OF_MEMORY; -- 2.7.4