Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9cc62e87 authored by Mark Salyzyn's avatar Mark Salyzyn Committed by Alain Vongsouvanh
Browse files

Parcel: file descriptor leak

Resolve a file descriptor leak when a request for
ashmem size adjustment is not filed.

Change-Id: I4ebccfd096ec5313725fd99dc3e025f9561d061f
(cherry picked from AOSP commit b454d8ff)
parent 8bb1a530
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -172,16 +172,16 @@ 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);
            }
            }
            return;
        }
    }