Fix typo and memory free 53/315053/1
authorsungwook79.park <sungwook79.park@samsung.com>
Wed, 24 Jul 2024 06:00:49 +0000 (15:00 +0900)
committersungwook79.park <sungwook79.park@samsung.com>
Wed, 24 Jul 2024 06:00:49 +0000 (15:00 +0900)
Change-Id: I78504ac44ce378d6580db74a98486d339b634250
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
client/tts.c
include/tts.h

index 85938dc..0968419 100644 (file)
@@ -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;
index 2aa270b..739e1df 100644 (file)
@@ -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,