From 478b2d80ed1d613f621e89a97a0b140004ebac29 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Sat, 30 Apr 2011 05:45:26 -0400 Subject: [PATCH] guestfs_close: Move local variables close to code that uses them. This is just code motion. --- src/guestfs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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; -- 1.8.3.1