Fix static analysis issue 67/134467/1 accepted/tizen/3.0/common/20170619.133431 accepted/tizen/3.0/common/20170620.123141 accepted/tizen/3.0/ivi/20170619.075509 accepted/tizen/3.0/ivi/20170620.101947 accepted/tizen/3.0/mobile/20170619.075459 accepted/tizen/3.0/mobile/20170620.101931 accepted/tizen/3.0/tv/20170619.075503 accepted/tizen/3.0/tv/20170620.101941 accepted/tizen/3.0/wearable/20170619.075507 accepted/tizen/3.0/wearable/20170620.101944 submit/tizen_3.0/20170619.010824 submit/tizen_3.0/20170620.101006
authorJunghyun Yeon <jungh.yeon@samsung.com>
Tue, 25 Apr 2017 01:45:31 +0000 (10:45 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 19 Jun 2017 00:37:09 +0000 (00:37 +0000)
Change-Id: I880b10644b72d6cf8890d60f0c338406a49d2c3f
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
(cherry picked from commit 01772445597eef8c63c15e08b08bf90a8affd47c)

src/pkgmgrinfo_updateinfo.c

index e599b8c..a2d210f 100644 (file)
@@ -280,26 +280,17 @@ API int pkgmgrinfo_updateinfo_get_usr_updateinfo(const char *pkgid,
        int ret;
        pkgmgrinfo_pkginfo_h pkginfo = NULL;
        bool is_global_pkg;
-       updateinfo_x *update_info;
        GSList *info_list = NULL;
 
        if (update_handle == NULL || pkgid == NULL)
                return PMINFO_R_EINVAL;
 
-       update_info = calloc(1, sizeof(updateinfo_x));
-       if (update_info == NULL) {
-               _LOGE("Out of memory");
-               return PMINFO_R_ERROR;
-       }
-
        ret = pkgmgrinfo_pkginfo_get_usr_pkginfo(pkgid, uid, &pkginfo);
-       if (ret != PMINFO_R_OK) {
-               free(update_info);
+       if (ret != PMINFO_R_OK)
                return ret;
-       }
+
        ret = pkgmgrinfo_pkginfo_is_global(pkginfo, &is_global_pkg);
        if (ret != PMINFO_R_OK) {
-               free(update_info);
                pkgmgrinfo_pkginfo_destroy_pkginfo(pkginfo);
                return ret;
        }