ocaml: Fix locking in event callbacks.
[libguestfs.git] / daemon / mount.c
index ccace75..128b05b 100644 (file)
@@ -79,6 +79,7 @@ do_mount_vfs (const char *options, const char *vfstype,
   if (is_root)
     root_mounted = 1;
 
+  free (error);
   return 0;
 }
 
@@ -349,7 +350,7 @@ do_mount_loop (const char *file, const char *mountpoint)
   }
 
   buf = sysroot_path (file);
-  if (!file) {
+  if (!buf) {
     reply_with_perror ("malloc");
     free (mp);
     return -1;
@@ -364,6 +365,7 @@ do_mount_loop (const char *file, const char *mountpoint)
     return -1;
   }
 
+  free (error);
   return 0;
 }