From 6613f465c802e4442e5497617201fc544b5391cf Mon Sep 17 00:00:00 2001 From: Minje Ahn Date: Wed, 8 Aug 2018 12:42:17 +0900 Subject: Fix memory leak Change-Id: Id41c86f180203f4c4f9e575760f0585ec10a77b6 Signed-off-by: Minje Ahn --- src/media_controller_server.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/media_controller_server.c b/src/media_controller_server.c index c4abf86..6e4380f 100755 --- a/src/media_controller_server.c +++ b/src/media_controller_server.c @@ -957,11 +957,18 @@ int mc_server_update_playlist_done(mc_server_h server, mc_playlist_h playlist) } ret = mc_db_update_playlist(mc_server->db_handle, mc_server->server_name, _playlist->playlist_name, query_list); - mc_retvm_if(ret != MEDIA_CONTROLLER_ERROR_NONE, ret, "fail to mc_db_update_playlist"); + if (ret != MEDIA_CONTROLLER_ERROR_NONE) { + mc_error("fail to mc_db_update_playlist"); + goto RELEASE; + } ret = __mc_server_send_message(mc_server, MC_DBUS_UPDATE_INTERFACE, MC_DBUS_SIGNAL_NAME_PLAYLIST, MC_PLAYLIST_UPDATED, 0, _playlist->playlist_name); - mc_retvm_if(ret != MEDIA_CONTROLLER_ERROR_NONE, ret, "fail to __mc_server_send_message"); + if (ret != MEDIA_CONTROLLER_ERROR_NONE) { + mc_error("fail to __mc_server_send_message"); + goto RELEASE; + } +RELEASE: for (idx = 0; idx < length; idx++) { __mc_server_playlist_item_release((mc_playlist_item_s*)g_list_nth_data(_playlist->item_list, idx)); } -- cgit v1.2.3