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;
|
return;
|
||||||
}
|
}
|
||||||
case BINDER_TYPE_FD: {
|
case BINDER_TYPE_FD: {
|
||||||
|
if (obj.cookie != 0) { // owned
|
||||||
if (outAshmemSize != NULL) {
|
if (outAshmemSize != NULL) {
|
||||||
if (obj.cookie != 0) {
|
|
||||||
int size = ashmem_get_size_region(obj.handle);
|
int size = ashmem_get_size_region(obj.handle);
|
||||||
if (size > 0) {
|
if (size > 0) {
|
||||||
*outAshmemSize -= size;
|
*outAshmemSize -= size;
|
||||||
}
|
}
|
||||||
|
|
||||||
close(obj.handle);
|
|
||||||
}
|
}
|
||||||
|
close(obj.handle);
|
||||||
#ifdef DISABLE_ASHMEM_TRACKING
|
#ifdef DISABLE_ASHMEM_TRACKING
|
||||||
} else if (obj.cookie != 0) {
|
} else if (obj.cookie != 0) {
|
||||||
close(obj.handle);
|
close(obj.handle);
|
||||||
|
Loading…
Reference in New Issue
Block a user