From 8eafa3ff9b3a1cadc3e00d41fa2cacf0f1db0dce Mon Sep 17 00:00:00 2001 From: Seoyeon Kim Date: Fri, 30 Mar 2018 11:05:53 +0900 Subject: [PATCH] [Tizen] Fix to memory leak in clipboard-impl-ecore-wl - Variable 'reply' is allocated from 'eldbus_proxy_send_and_block()'. - Added to eldbus_message_unref(reply) for memory free. Change-Id: I781ae2fadd7180ae44f15e822d40b956e59171c2 Signed-off-by: Seoyeon Kim --- .../clipboard/tizen-wayland/ecore-wl/clipboard-impl-ecore-wl.cpp | 6 ++++++ .../clipboard/tizen-wayland/ecore-wl2/clipboard-impl-ecore-wl2.cpp | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/dali/internal/clipboard/tizen-wayland/ecore-wl/clipboard-impl-ecore-wl.cpp b/dali/internal/clipboard/tizen-wayland/ecore-wl/clipboard-impl-ecore-wl.cpp index 4580e66..821a730 100644 --- a/dali/internal/clipboard/tizen-wayland/ecore-wl/clipboard-impl-ecore-wl.cpp +++ b/dali/internal/clipboard/tizen-wayland/ecore-wl/clipboard-impl-ecore-wl.cpp @@ -162,6 +162,10 @@ struct Clipboard::Impl DALI_LOG_ERROR("Unable to call method org.freedesktop.DBus.Properties.Get: %s %s", errname, errmsg); eldbus_message_unref(req); + if( reply ) + { + eldbus_message_unref(reply); + } return -1; } @@ -169,10 +173,12 @@ struct Clipboard::Impl { DALI_LOG_ERROR("Cannot get arguments from eldbus"); eldbus_message_unref(req); + eldbus_message_unref(reply); return -1; } eldbus_message_unref(req); + eldbus_message_unref(reply); DALI_LOG_ERROR("cbhm item count(%d)", count); return count; } diff --git a/dali/internal/clipboard/tizen-wayland/ecore-wl2/clipboard-impl-ecore-wl2.cpp b/dali/internal/clipboard/tizen-wayland/ecore-wl2/clipboard-impl-ecore-wl2.cpp index 8bcf344..309a07a 100644 --- a/dali/internal/clipboard/tizen-wayland/ecore-wl2/clipboard-impl-ecore-wl2.cpp +++ b/dali/internal/clipboard/tizen-wayland/ecore-wl2/clipboard-impl-ecore-wl2.cpp @@ -160,6 +160,10 @@ struct Clipboard::Impl DALI_LOG_ERROR("Unable to call method org.freedesktop.DBus.Properties.Get: %s %s", errname, errmsg); eldbus_message_unref(req); + if( reply ) + { + eldbus_message_unref(reply); + } return -1; } @@ -167,10 +171,12 @@ struct Clipboard::Impl { DALI_LOG_ERROR("Cannot get arguments from eldbus"); eldbus_message_unref(req); + eldbus_message_unref(reply); return -1; } eldbus_message_unref(req); + eldbus_message_unref(reply); DALI_LOG_ERROR("cbhm item count(%d)", count); return count; } -- 2.7.4