Skip to content

Commit b3ff767

Browse files
author
Anton Ivanov
committed
Harden construction sites of android::StrongPointer.
Bug: 393217449 Test: presubmit Flag: EXEMPT_refactor Change-Id: I36bc3241010fd0ffd658dc0a7fc9f028c1118372 Ignore-AOSP-First: Will merge to AOSP after bug is fixed.
1 parent 1a25e57 commit b3ff767

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

libs/binder/include/binder/SafeInterface.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class LIBBINDER_EXPORTED ParcelHandler {
7979
template <typename T>
8080
typename std::enable_if<std::is_base_of<Flattenable<T>, T>::value, status_t>::type read(
8181
const Parcel& parcel, sp<T>* t) const {
82-
*t = new T{};
82+
*t = sp<T>::make();
8383
return callParcel("read(sp<Flattenable>)", [&]() { return parcel.read(*(t->get())); });
8484
}
8585
template <typename T>

0 commit comments

Comments
 (0)