On mkdtemp error, free tmppath and not tmpdir (which is CLEANUP_FREE).
Fixes commit 673a7a959c15e9a389a13620f3a10cb12a9537d0.
---
src/tmpdirs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/tmpdirs.c b/src/tmpdirs.c
index 0a36f2f..afa3dd4 100644
--- a/src/tmpdirs.c
+++ b/src/tmpdirs.c
@@ -157,7 +157,7 @@ lazy_make_tmpdir (guestfs_h *g, char *(*getdir) (guestfs_h *g), char
**dest)
char *tmppath = safe_asprintf (g, "%s/libguestfsXXXXXX", tmpdir);
if (mkdtemp (tmppath) == NULL) {
perrorf (g, _("%s: cannot create temporary directory"), tmppath);
- free (tmpdir);
+ free (tmppath);
return -1;
}
/* Allow qemu (which may be running as qemu.qemu) to read in this
--
2.5.0