]> git.ozlabs.org Git - petitboot/blobdiff - discover/parser.c
ui/common: Only close valid file descriptor
[petitboot] / discover / parser.c
index 7833981ae3785d11aa072066f4aa834ae3a4acbc..fbf31b2806060009a4d136906fc5b03be64917dc 100644 (file)
@@ -25,7 +25,7 @@ static char *local_path(struct discover_context *ctx,
                struct discover_device *dev,
                const char *filename)
 {
-       return join_paths(ctx, dev->mount_path, filename);
+       return join_paths(ctx, dev->root_path, filename);
 }
 
 int parser_request_file(struct discover_context *ctx,
@@ -62,6 +62,7 @@ int parser_check_dir(struct discover_context *ctx,
        path = local_path(ctx, dev, dirname);
 
        rc = stat(path, &statbuf);
+       talloc_free(path);
        if (!rc)
                return -1;