summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazumasa Mitsunari <knimitz@witz-inc.co.jp>2017-12-19 10:01:44 +0900
committerKazumasa Mitsunari <knimitz@witz-inc.co.jp>2017-12-19 10:30:51 +0900
commite03cee108a5fa9d38e7292ee1a17e29e8c3367b7 (patch)
treef50055bc62e531b3678f56dc156d86e29bc0f2c8
parent68462c7180f69f2c9df1e161a0f86a1f52f33360 (diff)
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 <knimitz@witz-inc.co.jp>
-rw-r--r--src/libwindowmanager.cpp11
1 files changed, 1 insertions, 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;