crash-manager: Fix error checking for pkgmgrinfo*() invocation 40/200140/3
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 19 Feb 2019 12:04:34 +0000 (13:04 +0100)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Tue, 19 Feb 2019 12:21:49 +0000 (13:21 +0100)
This commit fixes 'unchecked return value' as reported by coverity.

Change-Id: I8c31504fd03826862f85df5ff24d7752a12262e9

src/crash-manager/crash-manager.c

index e2c6a0f..dee6e62 100644 (file)
@@ -143,13 +143,11 @@ static int appinfo_get_appid_func(pkgmgrinfo_appinfo_h handle,
                void *user_data)
 {
        char *str = NULL;
-       int ret = PMINFO_R_ERROR;
 
-       pkgmgrinfo_appinfo_get_appid(handle, &str);
-       if (str) {
+       int ret = pkgmgrinfo_appinfo_get_appid(handle, &str);
+       if (ret == PMINFO_R_OK && str)
                (*(char **)user_data) = strdup(str);
-               ret = PMINFO_R_OK;
-       }
+
        return ret;
 }