From: Richard W.M. Jones Date: Sat, 30 Apr 2011 09:45:26 +0000 (-0400) Subject: guestfs_close: Move local variables close to code that uses them. X-Git-Tag: 1.11.4~17 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=478b2d80ed1d613f621e89a97a0b140004ebac29;p=libguestfs.git guestfs_close: Move local variables close to code that uses them. This is just code motion. --- diff --git a/src/guestfs.c b/src/guestfs.c index 7868e8f..b2cf553 100644 --- a/src/guestfs.c +++ b/src/guestfs.c @@ -169,9 +169,6 @@ guestfs_create (void) void guestfs_close (guestfs_h *g) { - int i; - guestfs_h *gg; - if (g->state == NO_HANDLE) { /* Not safe to call ANY callbacks here, so ... */ fprintf (stderr, _("guestfs_close: called twice on the same handle\n")); @@ -219,6 +216,8 @@ guestfs_close (guestfs_h *g) remove_tmpdir (g); if (g->cmdline) { + int i; + for (i = 0; i < g->cmdline_size; ++i) free (g->cmdline[i]); free (g->cmdline); @@ -231,6 +230,8 @@ guestfs_close (guestfs_h *g) if (handles == g) handles = g->next; else { + guestfs_h *gg; + for (gg = handles; gg->next != g; gg = gg->next) ; gg->next = g->next;