From: sungwook79.park Date: Wed, 24 Jul 2024 06:00:49 +0000 (+0900) Subject: Fix typo and memory free X-Git-Tag: accepted/tizen/unified/20240829.091438~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F53%2F315053%2F1;p=platform%2Fcore%2Fuifw%2Ftts.git Fix typo and memory free Change-Id: I78504ac44ce378d6580db74a98486d339b634250 Signed-off-by: sungwook79.park --- diff --git a/client/tts.c b/client/tts.c index 85938dc7..09684197 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 2aa270b9..739e1df3 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,