Add null check to avoid null reference problem 25/258625/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Fri, 21 May 2021 07:44:34 +0000 (16:44 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Fri, 21 May 2021 07:44:34 +0000 (16:44 +0900)
Change-Id: I717cc485a79eafd97f41f4ca70671dc1a964808f
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
server/ttsd_server.c

index 18bccfb..892095b 100644 (file)
@@ -233,7 +233,7 @@ int ttsd_send_result(ttse_result_event_e event, const void* data, unsigned int d
        temp_sound_data->rate = 0;
        temp_sound_data->data_size = 0;
 
-       if (0 < data_size) {
+       if (NULL != data && 0 < data_size) {
                temp_sound_data->data = (char*)calloc(data_size + 5, sizeof(char));
                if (NULL != temp_sound_data->data) {
                        memcpy(temp_sound_data->data, data, data_size);