From e3b1ceeb30cd3e9e2854479b0cec237628486b36 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Wed, 24 Jul 2024 15:00:49 +0900 Subject: [PATCH] Fix typo and memory free Change-Id: I78504ac44ce378d6580db74a98486d339b634250 Signed-off-by: sungwook79.park --- client/tts.c | 14 ++++++++++---- include/tts.h | 6 +++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/client/tts.c b/client/tts.c index 85938dc..0968419 100644 --- a/client/tts.c +++ b/client/tts.c @@ -1481,12 +1481,18 @@ int tts_synthesis_parameter_destroy(tts_synthesis_parameter_h parameter) RETVM_IF(NULL == parameter, TTS_ERROR_INVALID_PARAMETER, "[ERROR] Input handle is null"); - free(parameter->language); - parameter->language = NULL; - free(parameter->ptts_id); - parameter->ptts_id = NULL; + if (parameter->language) { + free(parameter->language); + parameter->language = NULL; + } + + if (parameter->ptts_id) { + free(parameter->ptts_id); + parameter->ptts_id = NULL; + } free(parameter); + parameter = NULL; SLOG(LOG_DEBUG, TAG_TTSC, "[SUCCESS] Destroy the handle for a synthesis parameter"); return TTS_ERROR_NONE; diff --git a/include/tts.h b/include/tts.h index 2aa270b..739e1df 100644 --- a/include/tts.h +++ b/include/tts.h @@ -1152,7 +1152,7 @@ int tts_unset_synthesized_pcm_cb(tts_h tts); /** - * @brief Adds silence for the specified amount of time + * @brief Adds silence for the specified amount of time. * @since_tizen 9.0 * @remarks The maximum silent time is 5000 msec. If you want to perform a silent time of more than 5000 msec, call this function several times. * @param[in] tts The TTS handle @@ -1174,7 +1174,7 @@ int tts_add_silent_utterance(tts_h tts, unsigned int duration_in_msec, int* utt_ /** * @brief Creates a handle for TTS synthesis parameters. * @since_tizen 9.0 - * @remarks If the function succeeds, @a paramter handle must be released with tts_synthesis_parameter_destroy(). + * @remarks If the function succeeds, @a parameter handle must be released with tts_synthesis_parameter_destroy(). * @param[out] parameter The TTS synthesis parameter handle * @return @c 0 on success, * otherwise a negative error value @@ -1187,7 +1187,7 @@ int tts_add_silent_utterance(tts_h tts, unsigned int duration_in_msec, int* utt_ int tts_synthesis_parameter_create(tts_synthesis_parameter_h *parameter); /** - * @brief Destroys the TTS synthesis paramter handle. + * @brief Destroys the TTS synthesis parameter handle. * @since_tizen 9.0 * @param[in] parameter The TTS synthesis parameter handle * @return @c 0 on success, -- 2.7.4