Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
drives: fix deletion of servers on error
Make sure to not skip any of the created server, and to always free
the "server" array.
  • Loading branch information
ptoscano authored and rwmjones committed Aug 19, 2014
1 parent 06aa1bf commit b53286a
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/drives.c
Expand Up @@ -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;
}
}
Expand Down

0 comments on commit b53286a

Please sign in to comment.