[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [qemu-xen-unstable] block-nbd: close sock in nbd_open() error path



commit 50c84619ea9aa6c24dd1c1215b25dfb73fbcc3c4
Author:     Yunlei Ding <yunlei.ding@xxxxxxxxxx>
AuthorDate: Tue Mar 11 10:12:01 2014 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri Oct 16 16:52:07 2015 +0100

    block-nbd: close sock in nbd_open() error path
    
    Close sock handle before return.
    
    Signed-off-by: Yunlei Ding <yunlei.ding@xxxxxxxxxx>
    Coverity-ID: 1055914
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 block-nbd.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/block-nbd.c b/block-nbd.c
index dc63183..e2c90eb 100644
--- a/block-nbd.c
+++ b/block-nbd.c
@@ -88,7 +88,10 @@ static int nbd_open(BlockDriverState *bs, const char* 
filename, int flags)
 
     ret = nbd_receive_negotiate(sock, &size, &blocksize);
     if (ret == -1)
+    {
+        close(sock);
         return -errno;
+    }
 
     s->sock = sock;
     s->size = size;
--
generated by git-patchbot for /home/xen/git/qemu-xen-unstable.git

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.