Fix descriptor leak after accepting connections
After accepting a connection on a listening socket and
storing the resulting FileDescriptor into a newly created
LocalSocketImpl, the new impl's "descriptor was created
locally and should be closed normally" flag should be set.
(cherrypicked from 3e7305c6bf6062b5cb1e2ddcec6c6d30b4a8bc0d)
Bug: 11805817
Change-Id: I0a1a7c62ec3fbcf647a44a22110ddc778d14e5f4
diff --git a/core/java/android/net/LocalSocketImpl.java b/core/java/android/net/LocalSocketImpl.java
index b2ee50a..119e533 100644
--- a/core/java/android/net/LocalSocketImpl.java
+++ b/core/java/android/net/LocalSocketImpl.java
@@ -326,6 +326,7 @@
}
s.fd = accept(fd, s);
+ s.mFdCreatedInternally = true;
}
/**
@@ -536,4 +537,3 @@
close();
}
}
-