summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Lewandowski <k.lewandowsk@samsung.com>2019-02-19 12:04:34 (GMT)
committerKarol Lewandowski <k.lewandowsk@samsung.com>2019-02-21 12:26:18 (GMT)
commit68d1911e91ae2b0f9f061a06fe9eeaa54b9933fb (patch)
tree77daae603fa6252a6ad4934f3d88042d55dee155
parente280453bbf859c8941ab46ccd9ec4580be492242 (diff)
downloadcrash-worker-68d1911e91ae2b0f9f061a06fe9eeaa54b9933fb.zip
crash-worker-68d1911e91ae2b0f9f061a06fe9eeaa54b9933fb.tar.gz
crash-worker-68d1911e91ae2b0f9f061a06fe9eeaa54b9933fb.tar.bz2
crash-manager: Fix error checking for pkgmgrinfo*() invocationrefs/changes/25/200325/1
This commit fixes 'unchecked return value' as reported by coverity. Change-Id: I8c31504fd03826862f85df5ff24d7752a12262e9
-rw-r--r--src/crash-manager/crash-manager.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/crash-manager/crash-manager.c b/src/crash-manager/crash-manager.c
index 2627b06..69a463b 100644
--- a/src/crash-manager/crash-manager.c
+++ b/src/crash-manager/crash-manager.c
@@ -133,13 +133,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;
}