Change-Id: I73fbcf79d9d4d20d19df168f3680aab7666eeb93
Signed-off-by: Ilho Kim <ilho159.kim@samsung.com>
return PKGMGR_R_EINVAL;
}
- auto* con = new Connector(PC_REQUEST);
+ pkgmgr_client_t* raw_pc =
+ static_cast<pkgmgr_client_t*>(calloc(1, sizeof(pkgmgr_client_t)));
+ if (raw_pc == nullptr) {
+ _E("out of memory");
+ return PKGMGR_R_ENOMEM;
+ }
+
+ raw_pc->pc_type = PC_REQUEST;
+
+ if (pkgmgr_client_connection_connect(raw_pc) != PKGMGR_R_OK) {
+ _E("pkgmgr_client_connection_connect fail");
+ free(raw_pc);
+ return PKGMGR_R_ECOMM;
+ }
+
+ auto* con = new Connector(PC_REQUEST, raw_pc);
auto* proxy = con->GetCacheProxy();
if (proxy == nullptr)
return PKGMGR_R_EIO;