Parcel: file descriptor leak
Resolve a file descriptor leak when a request for ashmem size adjustment is not filed. Change-Id: I4ebccfd096ec5313725fd99dc3e025f9561d061f
This commit is contained in:
parent
0c5f3af37a
commit
e481771aa3
@ -173,15 +173,14 @@ static void release_object(const sp<ProcessState>& proc,
|
||||
return;
|
||||
}
|
||||
case BINDER_TYPE_FD: {
|
||||
if (obj.cookie != 0) { // owned
|
||||
if (outAshmemSize != NULL) {
|
||||
if (obj.cookie != 0) {
|
||||
int size = ashmem_get_size_region(obj.handle);
|
||||
if (size > 0) {
|
||||
*outAshmemSize -= size;
|
||||
}
|
||||
|
||||
close(obj.handle);
|
||||
}
|
||||
close(obj.handle);
|
||||
#ifdef DISABLE_ASHMEM_TRACKING
|
||||
} else if (obj.cookie != 0) {
|
||||
close(obj.handle);
|
||||
|
Loading…
Reference in New Issue
Block a user