From e03cee108a5fa9d38e7292ee1a17e29e8c3367b7 Mon Sep 17 00:00:00 2001 From: Kazumasa Mitsunari Date: Tue, 19 Dec 2017 10:01:44 +0900 Subject: Fix the bug in error case If window manager server returns fail(afb_req_fail) in requestSurface, the illegal memory access to json object happens. So fix not to access to the json object after using it in afb_wsj1_call_j. Change-Id: I1f422851b6476187f104dcc27d05ba13094b52d6 Signed-off-by: Kazumasa Mitsunari --- src/libwindowmanager.cpp | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/src/libwindowmanager.cpp b/src/libwindowmanager.cpp index 18cde43..9b9c555 100644 --- a/src/libwindowmanager.cpp +++ b/src/libwindowmanager.cpp @@ -271,12 +271,6 @@ int LibWindowmanager::Impl::requestSurface(json_object *object) { rc = -EINVAL; return; } - } else { - HMI_ERROR("libwm", "Could not get surface ID from WM: %s", - j != nullptr ? json_object_to_json_string_ext( - j, JSON_C_TO_STRING_PRETTY) - : "no-info"); - rc = -EINVAL; } }); @@ -488,10 +482,7 @@ int LibWindowmanager::Impl::api_call( } if (rc < 0) { - HMI_ERROR("libwm", "calling %s/%s(%s) failed: %m", wmAPI, verb, - json_object_to_json_string_ext(object, JSON_C_TO_STRING_PRETTY)); - // Call the reply handler regardless with a NULL json_object* - onReply(false, nullptr); + HMI_ERROR("libwm", "calling %s/%s failed: %m", wmAPI, verb); } return rc; -- cgit 1.2.3-korg