From: Suyeon Hwang Date: Thu, 11 May 2017 08:22:32 +0000 (+0900) Subject: Fix memory leak X-Git-Tag: accepted/tizen/unified/20170512.023656^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Ftts.git;a=commitdiff_plain;h=926c7e035a433f29fb087f397bca1a5441ab2ac6 Fix memory leak Change-Id: I0d2971545128ca20df768c2f6b4379441a2bcfb8 Signed-off-by: Suyeon Hwang --- diff --git a/server/ttsd_server.c b/server/ttsd_server.c index 03f1e5e..c99f4a3 100644 --- a/server/ttsd_server.c +++ b/server/ttsd_server.c @@ -1209,6 +1209,14 @@ int ttsd_server_add_pcm(int uid, int event, void* data, int data_size, int audio if (0 != ttsd_data_add_sound_data(uid, temp_sound_data)) { SECURE_SLOG(LOG_ERROR, tts_tag(), "[SERVER ERROR] Fail to add sound data : uid(%d)", uid); + + if (NULL != temp_sound_data->data) { + free(temp_sound_data->data); + temp_sound_data->data = NULL; + } + + free(temp_sound_data); + temp_sound_data = NULL; } if (0 != ttsd_player_play(uid)) {