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 01:36:56 +0000
commitae757d42f81d5c9e06f9c83c1a6bc0e9f2365655 (patch)
tree6708a6649938139477c2ef99c6805b51c86e4e51
parent0919200fbe72e915fcc2b0848ca35549594a689d (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;