Check whether pointer is NULL or not, before use 01/281801/1
authorwn.jang <wn.jang@samsung.com>
Thu, 22 Sep 2022 05:09:54 +0000 (14:09 +0900)
committerwn.jang <wn.jang@samsung.com>
Thu, 22 Sep 2022 05:09:54 +0000 (14:09 +0900)
Change-Id: I498b36afbee0247b6c5add8ca7b976df2211ed1a

server/ttsd_server.c

index c50057e..f4e6a40 100644 (file)
@@ -586,8 +586,10 @@ static Eina_Bool __state_changed_timer_cb(void *data)
 static void __state_changed_cb(ttsd_state_e before, ttsd_state_e current)
 {
        state_changed_args_t* args = (state_changed_args_t*)calloc(1, sizeof(state_changed_args_t));
-       args->before = before;
-       args->current = current;
+       if (NULL != args) {
+               args->before = before;
+               args->current = current;
+       }
 
        SLOG(LOG_INFO, tts_tag(), "[Server] Notify state chanaged from (%d) to (%d).", before, current);
        g_notify_state_timer = ecore_timer_add(0.0, __state_changed_timer_cb, args);