Fix memory leak 89/186189/1 accepted/tizen/unified/20180808.141319 submit/tizen/20180808.060658
authorMinje Ahn <minje.ahn@samsung.com>
Wed, 8 Aug 2018 03:42:17 +0000 (12:42 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Wed, 8 Aug 2018 03:42:17 +0000 (12:42 +0900)
Change-Id: Id41c86f180203f4c4f9e575760f0585ec10a77b6
Signed-off-by: Minje Ahn <minje.ahn@samsung.com>
src/media_controller_server.c

index c4abf86..6e4380f 100755 (executable)
@@ -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));
        }