mirror of
https://github.com/openharmony/appexecfwk_standard.git
synced 2026-07-01 20:24:01 -04:00
!1392 解决stream install空指针问题
Merge pull request !1392 from shilei91/master
This commit is contained in:
@@ -365,13 +365,12 @@ ErrCode BundleInstallerProxy::WriteFileToStream(sptr<IBundleStreamInstaller> &st
|
||||
int32_t outputFd = streamInstaller->CreateStream(hapName, 0);
|
||||
if (outputFd < 0) {
|
||||
APP_LOGE("write file to stream failed due to invalid file descriptor");
|
||||
close(outputFd);
|
||||
return ERR_APPEXECFWK_INSTALL_FILE_PATH_INVALID;
|
||||
}
|
||||
|
||||
int32_t inputFd = open(path.c_str(), O_RDONLY);
|
||||
if (inputFd < 0) {
|
||||
close(inputFd);
|
||||
close(outputFd);
|
||||
APP_LOGE("write file to stream failed due to open the hap file");
|
||||
return ERR_APPEXECFWK_INSTALL_FILE_PATH_INVALID;
|
||||
}
|
||||
|
||||
@@ -443,6 +443,10 @@ sptr<IBundleStreamInstaller> BundleInstallerHost::CreateStreamInstaller(const In
|
||||
auto uid = IPCSkeleton::GetCallingUid();
|
||||
sptr<BundleStreamInstallerHostImpl> streamInstaller(new (std::nothrow) BundleStreamInstallerHostImpl(
|
||||
++streamInstallerIds_, uid));
|
||||
if (streamInstaller == nullptr) {
|
||||
APP_LOGE("streamInstaller is nullptr");
|
||||
return nullptr;
|
||||
}
|
||||
bool res = streamInstaller->Init(installParam);
|
||||
if (!res) {
|
||||
APP_LOGE("stream installer init failed");
|
||||
|
||||
Reference in New Issue
Block a user