remove manually freeing the variable mDeathRecipient

The variable `mDeathRecipient` will automatically free the allocated
memory when it is destructed. This CL deletes the code for manually
releasing the variable `mDeathRecipient` to avoid the same variable
being freed twice.

Bug: 296617022
Test: Run fuzzer test.
Change-Id: I733f7f8d26e48a9434d41c5098f39ad91208abeb
This commit is contained in:
Zhanglong Xia
2023-08-24 15:38:05 +08:00
parent 7f2619ddff
commit 3297a174d6
2 changed files with 1 additions and 5 deletions

View File

@@ -59,10 +59,6 @@ ThreadChip::ThreadChip(char* url) : mUrl(), mRxFrameBuffer(), mCallback(nullptr)
AIBinder_DeathRecipient_setOnUnlinked(mDeathRecipient.get(), ThreadChip::onBinderUnlinkedJump);
}
ThreadChip::~ThreadChip() {
AIBinder_DeathRecipient_delete(mDeathRecipient.get());
}
void ThreadChip::onBinderDiedJump(void* context) {
reinterpret_cast<ThreadChip*>(context)->onBinderDied();
}

View File

@@ -34,7 +34,7 @@ namespace threadnetwork {
class ThreadChip : public BnThreadChip, ot::Posix::Mainloop::Source {
public:
ThreadChip(char* url);
~ThreadChip();
~ThreadChip() {}
ndk::ScopedAStatus open(const std::shared_ptr<IThreadChipCallback>& in_callback) override;
ndk::ScopedAStatus close() override;