diff options
author | seungha.son <seungha.son@samsung.com> | 2017-01-25 17:09:23 +0900 |
---|---|---|
committer | seungha.son <seungha.son@samsung.com> | 2017-02-01 07:30:13 +0900 |
commit | 681bbfaf8205b444a4d0c5e0b3b092d53151fb1d (patch) | |
tree | 584c79d545ac70d10e3d95a2b891256e6a178418 | |
parent | 3f50d6575b51c01b7cc20ee19e1a55da512d6f30 (diff) | |
download | notification-681bbfaf8205b444a4d0c5e0b3b092d53151fb1d.tar.gz notification-681bbfaf8205b444a4d0c5e0b3b092d53151fb1d.tar.bz2 notification-681bbfaf8205b444a4d0c5e0b3b092d53151fb1d.zip |
Fix memory leaksubmit/tizen_3.0/20170201.003016accepted/tizen/3.0/wearable/20170201.091625accepted/tizen/3.0/tv/20170201.091601accepted/tizen/3.0/mobile/20170201.091516accepted/tizen/3.0/ivi/20170201.091702accepted/tizen/3.0/common/20170201.164546
- If body is floating, memory corruption is occured when msg get body
in g_dbus_connection_send_message_with_reply()
So, this problem can be solved by increase reference count of body
when body is floating.
Signed-off-by: seungha.son <seungha.son@samsung.com>
Change-Id: Ifaffa3153b111d91a8e20c6ad5c9e228548983c9
-rwxr-xr-x | src/notification_ipc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/notification_ipc.c b/src/notification_ipc.c index 540b3b6..fdecf6f 100755 --- a/src/notification_ipc.c +++ b/src/notification_ipc.c @@ -792,6 +792,9 @@ static int _send_async_noti(GVariant *body, result_cb_item *cb_item, char *cmd) /* LCOV_EXCL_STOP */ } + if (g_variant_is_floating(body)) + g_variant_ref(body); + if (body != NULL) g_dbus_message_set_body(msg, body); @@ -805,6 +808,9 @@ static int _send_async_noti(GVariant *body, result_cb_item *cb_item, char *cmd) (GAsyncReadyCallback)_send_message_with_reply_async_cb, cb_item); + if (msg) + g_object_unref(msg); + NOTIFICATION_DBG("_send_async_noti done !!"); return NOTIFICATION_ERROR_NONE; } |