From: Changgyu Choi Date: Wed, 22 Feb 2023 02:28:10 +0000 (+0900) Subject: Fix static analysis issues X-Git-Tag: accepted/tizen/unified/20230302.131108~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F07%2F288707%2F1;p=platform%2Fcore%2Fappfw%2Fapp-core.git Fix static analysis issues Add to check whether err is nullptr or not. Change-Id: Ie21ba4836914da458ae80d6b11f0462079e43351 Signed-off-by: Changgyu Choi --- diff --git a/tizen-cpp/app-core-cpp/app_core_base.cc b/tizen-cpp/app-core-cpp/app_core_base.cc index ad7aa52..5e8803a 100644 --- a/tizen-cpp/app-core-cpp/app_core_base.cc +++ b/tizen-cpp/app-core-cpp/app_core_base.cc @@ -365,8 +365,10 @@ void AppCoreBase::Impl::InitSuspendDbusHandler(gpointer data) { GError* err = nullptr; __bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, nullptr, &err); if (__bus == nullptr) { - _E("Failed to connect to the D-BUS daemon: %s", err->message); - g_error_free(err); + _E("Failed to connect to the D-BUS daemon: %s", err ? err->message : ""); + if (err) + g_error_free(err); + return; } }