Fix static analysis issue 09/126709/2
authorJunghyun Yeon <jungh.yeon@samsung.com>
Tue, 25 Apr 2017 01:45:31 +0000 (10:45 +0900)
committerSangyoon Jang <s89.jang@samsung.com>
Tue, 25 Apr 2017 04:45:30 +0000 (04:45 +0000)
Change-Id: I880b10644b72d6cf8890d60f0c338406a49d2c3f
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
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;
        }