[Pkg-libvirt-commits] [libguestfs] 124/266: drives: fix deletion of servers on error

Hilko Bengen bengen at moszumanska.debian.org
Fri Oct 3 14:41:50 UTC 2014


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag debian/1%1.27.35-1
in repository libguestfs.

commit b53286a6432b8b381769cd8e8a0c235ce13d58cf
Author: Pino Toscano <ptoscano at redhat.com>
Date:   Mon Aug 18 14:56:08 2014 +0200

    drives: fix deletion of servers on error
    
    Make sure to not skip any of the created server, and to always free
    the "server" array.
---
 src/drives.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/drives.c b/src/drives.c
index 4bd8328..85c1495 100644
--- a/src/drives.c
+++ b/src/drives.c
@@ -743,8 +743,7 @@ parse_servers (guestfs_h *g, char *const *strs,
 
   for (i = 0; i < n; ++i) {
     if (parse_one_server (g, strs[i], &servers[i]) == -1) {
-      if (i > 0)
-        free_drive_servers (servers, i-1);
+      free_drive_servers (servers, i);
       return -1;
     }
   }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-libvirt/libguestfs.git



More information about the Pkg-libvirt-commits mailing list