Remove unnecessary allocation 63/227263/1
authorjiyong.min <jiyong.min@samsung.com>
Wed, 11 Mar 2020 04:29:45 +0000 (13:29 +0900)
committerjiyong.min <jiyong.min@samsung.com>
Wed, 11 Mar 2020 04:29:45 +0000 (13:29 +0900)
  - The 'playback' is allocated by _mc_db_get_playback_info() function,
    so it is redundant allocation before calling the function.

Change-Id: I0a6d90db3b85e0b2d841c7cc368bb6cbc74d3b8c

src/media_controller_client.c

index cc6c134..575a79c 100644 (file)
@@ -103,9 +103,6 @@ static void __client_playback_cb(const char *interface_name, const char *signal_
 
        mc_secure_debug("__client_playback_cb(%s, %s, %s, %s, %p)", interface_name, signal_name, message, request_id, user_data);
 
-       playback = (media_controller_playback_s *)calloc(1, sizeof(media_controller_playback_s));
-       mc_retm_if(playback == NULL, "Error allocation memory");
-
        ret = _mc_db_get_playback_info(mc_client->db_handle, message, &playback);
        if (ret != MEDIA_CONTROLLER_ERROR_NONE)
                mc_error("Fail to _mc_db_get_playback_info");