Fix memory leaks of set_private_data 41/166241/1
authorSuyeon Hwang <stom.hwang@samsung.com>
Tue, 9 Jan 2018 02:53:03 +0000 (11:53 +0900)
committerSuyeon Hwang <stom.hwang@samsung.com>
Tue, 9 Jan 2018 02:53:03 +0000 (11:53 +0900)
Change-Id: Ief58b5b30a825033b5e714652c3edd460f9748a4
Signed-off-by: Suyeon Hwang <stom.hwang@samsung.com>
client/vc_mgr_dbus.c
server/vcd_dbus.c

index fd96dc3..26124cd 100644 (file)
@@ -1443,6 +1443,8 @@ int vc_mgr_dbus_request_set_private_data(int pid, const char* key, const char* d
        /* send the message and flush the connection */
        if (1 != dbus_connection_send(g_m_conn_sender, msg, NULL)) {
                SLOG(LOG_ERROR, TAG_VCM, "[Dbus ERROR] Fail to send private data");
+               dbus_message_unref(msg);
+               return VC_ERROR_OPERATION_FAILED;
        } else {
                SLOG(LOG_ERROR, TAG_VCM, "[Dbus] Success to send private data");
                dbus_connection_flush(g_m_conn_sender);
index 21ed6d7..8091d79 100755 (executable)
@@ -829,6 +829,7 @@ int vcdc_send_request_set_private_data(int pid, const char* key, const char* dat
 
        if (1 != dbus_connection_send(g_conn_sender, msg, NULL)) {
                SLOG(LOG_ERROR, TAG_VCD, "[Dbus ERROR] Fail to Send request set private data");
+               dbus_message_unref(msg);
                return VCD_ERROR_OPERATION_FAILED;
        } else {
                SLOG(LOG_DEBUG, TAG_VCD, "[Dbus] SUCCESS Send request set private data");