summaryrefslogtreecommitdiffstats
path: root/src
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 /src
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>
Diffstat (limited to 'src')
-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;
> 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365