Fix memory leak 59/128759/1 accepted/tizen/unified/20170512.023656 submit/tizen/20170511.114242 tizen_4.0.m1_release
authorSuyeon Hwang <stom.hwang@samsung.com>
Thu, 11 May 2017 08:22:32 +0000 (17:22 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Thu, 11 May 2017 08:22:32 +0000 (17:22 +0900)
Change-Id: I0d2971545128ca20df768c2f6b4379441a2bcfb8
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
server/ttsd_server.c

index 03f1e5e..c99f4a3 100644 (file)
@@ -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)) {