commit | e5d1fca0f20babbe355957b9ba536fe6187691cc | [log] [tgz] |
---|---|---|
author | Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> | Wed Dec 07 15:01:49 2011 +0000 |
committer | Anthony Liguori <aliguori@us.ibm.com> | Mon Dec 12 17:06:21 2011 -0600 |
tree | 1b824059aa57b10bb5995e276673b9cfa0e6484b | |
parent | 842480d493a085fd9598d35b3318765699f88709 [diff] |
net: take ownership of fd in socket init functions 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. Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com> Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>