On Thu, Dec 8, 2011 at 8:57 PM, Stefan Hajnoczi wrote:
> On Thu, Dec 8, 2011 at 12:29 PM, Zhi Yong Wu wrote:
>> On Wed, Dec 7, 2011 at 11:01 PM, Stefan Hajnoczi
>> wrote:
>>> Today net/socket.c has no consistent policy for closing the socket file
>>> descriptor when initialization fails. This m
On Thu, Dec 8, 2011 at 12:29 PM, Zhi Yong Wu wrote:
> On Wed, Dec 7, 2011 at 11:01 PM, Stefan Hajnoczi
> wrote:
>> Today net/socket.c has no consistent policy for closing the socket file
>> descriptor when initialization fails. This means we leak the file
>> descriptor in some cases or we could
On Wed, Dec 7, 2011 at 11:01 PM, Stefan Hajnoczi
wrote:
> Today net/socket.c has no consistent policy for closing the socket file
> descriptor when initialization fails. This means we leak the file
> descriptor in some cases or we could also try to close it twice.
>
> Make error paths consistent
Today net/socket.c has no consistent policy for closing the socket file
descriptor when initialization fails. This means we leak the file
descriptor in some cases or we could also try to close it twice.
Make error paths consistent by taking ownership of the file descriptor
and closing it on error