diff --git a/interfaces/innerkits/src/bundle_active_event.cpp b/interfaces/innerkits/src/bundle_active_event.cpp index 3983c8a27adf3b598d0ab491970a45f7f71e57d1..3b1fd735033d44a3c0cd9fd7a194f321b19c39a3 100644 --- a/interfaces/innerkits/src/bundle_active_event.cpp +++ b/interfaces/innerkits/src/bundle_active_event.cpp @@ -176,6 +176,9 @@ bool BundleActiveEvent::Marshalling(Parcel &parcel) const BundleActiveEvent *BundleActiveEvent::Unmarshalling(Parcel &parcel) { BundleActiveEvent *result = new (std::nothrow) BundleActiveEvent(); + if (result == nullptr) { + return nullptr; + } result->bundleName_ = parcel.ReadString(); result->continuousTaskAbilityName_ = parcel.ReadString(); result->abilityName_ = parcel.ReadString(); diff --git a/interfaces/innerkits/src/bundle_active_event_stats.cpp b/interfaces/innerkits/src/bundle_active_event_stats.cpp index 4850e179b230e50634bc3c0e74acf704ea77801d..2c9531b7be344ad7a53699a9f87c3fbbf85e94e5 100644 --- a/interfaces/innerkits/src/bundle_active_event_stats.cpp +++ b/interfaces/innerkits/src/bundle_active_event_stats.cpp @@ -105,6 +105,9 @@ bool BundleActiveEventStats::Marshalling(Parcel &parcel) const BundleActiveEventStats *BundleActiveEventStats::Unmarshalling(Parcel &parcel) { BundleActiveEventStats *result = new (std::nothrow) BundleActiveEventStats(); + if (result == nullptr) { + return nullptr; + } result->eventId_ = parcel.ReadInt32(); result->beginTimeStamp_ = parcel.ReadInt64(); result->endTimeStamp_ = parcel.ReadInt64(); diff --git a/interfaces/innerkits/src/bundle_active_form_record.cpp b/interfaces/innerkits/src/bundle_active_form_record.cpp index 15bf981c9e680a6e3af16238d523dbd9d5b34a5b..ce1c74d06c3b4b267eb6be29a8f0b99d546b857d 100644 --- a/interfaces/innerkits/src/bundle_active_form_record.cpp +++ b/interfaces/innerkits/src/bundle_active_form_record.cpp @@ -74,6 +74,9 @@ bool BundleActiveFormRecord::Marshalling(Parcel &parcel) const BundleActiveFormRecord *BundleActiveFormRecord::Unmarshalling(Parcel &parcel) { BundleActiveFormRecord *result = new (std::nothrow) BundleActiveFormRecord(); + if (result == nullptr) { + return nullptr; + } result->formName_ = parcel.ReadString(); result->formDimension_ = parcel.ReadInt32(); result->formId_ = parcel.ReadInt64(); diff --git a/interfaces/innerkits/src/bundle_active_package_stats.cpp b/interfaces/innerkits/src/bundle_active_package_stats.cpp index c5f6e35b0d05a09780f186123f4eef3c9e8652c2..551429b34f98353ac289d9864f00e090029db59a 100644 --- a/interfaces/innerkits/src/bundle_active_package_stats.cpp +++ b/interfaces/innerkits/src/bundle_active_package_stats.cpp @@ -227,6 +227,9 @@ bool BundleActivePackageStats::Marshalling(Parcel &parcel) const BundleActivePackageStats *BundleActivePackageStats::Unmarshalling(Parcel &parcel) { BundleActivePackageStats *result = new (std::nothrow) BundleActivePackageStats(); + if (result == nullptr) { + return nullptr; + } result->bundleName_ = parcel.ReadString(); result->beginTimeStamp_ = parcel.ReadInt64(); result->lastTimeUsed_ = parcel.ReadInt64();