From: Suyeon Hwang Date: Fri, 21 May 2021 07:44:34 +0000 (+0900) Subject: Add null check to avoid null reference problem X-Git-Tag: submit/tizen/20210628.060348~33 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=71b0f188ff09b83b0100a7c51c10c7373dcdbae1;p=platform%2Fcore%2Fuifw%2Ftts.git Add null check to avoid null reference problem Change-Id: I717cc485a79eafd97f41f4ca70671dc1a964808f Signed-off-by: Suyeon Hwang --- diff --git a/server/ttsd_server.c b/server/ttsd_server.c index 18bccfbd..892095bb 100644 --- a/server/ttsd_server.c +++ b/server/ttsd_server.c @@ -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);