summaryrefslogtreecommitdiffstats
path: root/src/guestfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/guestfs.c')
-rw-r--r--src/guestfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/guestfs.c b/src/guestfs.c
index c5062575..0fed8cd2 100644
--- a/src/guestfs.c
+++ b/src/guestfs.c
@@ -268,7 +268,8 @@ guestfs_close (guestfs_h *g)
guestfs___call_callbacks_void (g, GUESTFS_EVENT_CLOSE);
/* Remove whole temporary directory. */
- guestfs___remove_tmpdir (g->tmpdir);
+ if (g->tmpdir)
+ guestfs___remove_tmpdir (g->tmpdir);
/* Test output file used by bindtests. */
if (g->test_fp != NULL)