Fix svace issue (add null checker) 81/306081/1
authorsooyeon <sooyeon.kim@samsung.com>
Fri, 16 Feb 2024 05:04:34 +0000 (14:04 +0900)
committersooyeon <sooyeon.kim@samsung.com>
Fri, 16 Feb 2024 05:04:34 +0000 (14:04 +0900)
Change-Id: Ie3608f29bc7a397eba91a392160a68fd9c08f40b
Signed-off-by: sooyeon <sooyeon.kim@samsung.com>
common/tts_config_mgr.c

index 7d1fa03a5ce04abc63d653ca09a3d833f35a8aa7..a16ee6fd613ee9f0c4c3b09b2427f1c2c464312a 100644 (file)
@@ -735,9 +735,11 @@ static Eina_Bool tts_config_mgr_inotify_event_cb(void* data, Ecore_Fd_Handler *f
                        SECURE_SLOG(LOG_DEBUG, TAG_TTSCONFIG, "Voice change(%s, %d)", config_info.language, config_info.type);
 
                        /* Call all callbacks of client*/
-                       invoke_voice_changed_event(before_lang, before_type, config_info.language, config_info.type, config_info.auto_voice);
+                       if (NULL != before_lang) {
+                               invoke_voice_changed_event(before_lang, before_type, config_info.language, config_info.type, config_info.auto_voice);
+                               free(before_lang);
+                       }
                        free(lang);
-                       free(before_lang);
                }
 
                if (-1 != speech_rate) {