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

Commit 285fc7a7 authored by Dave Platt's avatar Dave Platt Committed by Android (Google) Code Review
Browse files

Merge "Fix socket descriptor leak from Zygote to child app"

parents 833a9e58 70ef29b0
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -192,10 +192,16 @@ public class ZygoteInit {
    static void closeServerSocket() {
    static void closeServerSocket() {
        try {
        try {
            if (sServerSocket != null) {
            if (sServerSocket != null) {
                FileDescriptor fd = sServerSocket.getFileDescriptor();
                sServerSocket.close();
                sServerSocket.close();
                if (fd != null) {
                    Libcore.os.close(fd);
                }
            }
            }
        } catch (IOException ex) {
        } catch (IOException ex) {
            Log.e(TAG, "Zygote:  error closing sockets", ex);
            Log.e(TAG, "Zygote:  error closing sockets", ex);
        } catch (libcore.io.ErrnoException ex) {
            Log.e(TAG, "Zygote:  error closing descriptor", ex);
        }
        }


        sServerSocket = null;
        sServerSocket = null;