FIX COVERITY: Unchecked return 30/199630/1 accepted/tizen/unified/20190214.060707 submit/tizen/20190213.100443
authorDewal Agarwal <d1.agarwal@samsung.com>
Wed, 13 Feb 2019 09:57:21 +0000 (15:27 +0530)
committerDewal Agarwal <d1.agarwal@samsung.com>
Wed, 13 Feb 2019 09:57:21 +0000 (15:27 +0530)
Change-Id: Ic026d47eb1bbc2e2dbd9b1ee8fceedb34c183ee0
Signed-off-by: Dewal Agarwal <d1.agarwal@samsung.com>
src/server/Credential.cpp

index 7ace5c3..5657a2e 100644 (file)
@@ -97,8 +97,14 @@ Credential::Credential(GDBusConnection* conn, const std::string& busName) :
                __session = cynara_session_from_pid(__pid);
 
        char* cid = NULL;
-       cynara_creds_gdbus_get_client(conn, busName.c_str(), CLIENT_METHOD_DEFAULT, &cid);
-       cynara_creds_gdbus_get_user(conn, busName.c_str(), USER_METHOD_DEFAULT, &__user);
+       int err = -1;
+       err = cynara_creds_gdbus_get_client(conn, busName.c_str(), CLIENT_METHOD_DEFAULT, &cid);
+       if (err != CYNARA_API_SUCCESS)
+               _E("cynara_creds_gdbus_get_client failed - %d", err);
+
+       err = cynara_creds_gdbus_get_user(conn, busName.c_str(), USER_METHOD_DEFAULT, &__user);
+       if (err != CYNARA_API_SUCCESS)
+               _E("cynara_creds_gdbus_get_user failed - %d", err);
 
        _SD("%d, %s, %s, %s", __pid, cid, __session, __user);