libbinder_ndk: _delete APIs take * not **.
Since having ** requires having a pointer allocated on the stack. This
is pretty common if you are using an object within a scope, but causes
problems when it is not.
Bug: 111445392
Test: ./ndk/runtests.sh
Change-Id: If7586548af0b47d8e09178fc3b71af50d449e290
diff --git a/libs/binder/ndk/parcel.cpp b/libs/binder/ndk/parcel.cpp
index a063657..385e898 100644
--- a/libs/binder/ndk/parcel.cpp
+++ b/libs/binder/ndk/parcel.cpp
@@ -27,13 +27,8 @@
using ::android::sp;
using ::android::status_t;
-void AParcel_delete(AParcel** parcel) {
- if (parcel == nullptr) {
- return;
- }
-
- delete *parcel;
- *parcel = nullptr;
+void AParcel_delete(AParcel* parcel) {
+ delete parcel;
}
binder_status_t AParcel_writeStrongBinder(AParcel* parcel, AIBinder* binder) {