]> git.ozlabs.org Git - petitboot/blobdiff - discover/grub2/env.c
lib: Move generic file-handling code to lib/
[petitboot] / discover / grub2 / env.c
index c887c7511297c9829dab795c6cc9d84adce3401a..9de5e9f95d819df9170f8031a870a5dceb0ca0df 100644 (file)
@@ -3,12 +3,12 @@
 #include <string.h>
 
 #include <log/log.h>
+#include <file/file.h>
 #include <types/types.h>
 #include <talloc/talloc.h>
 #include <util/util.h>
 
 #include <discover/parser.h>
-#include <discover/file.h>
 
 #include "grub2.h"
 
@@ -84,10 +84,10 @@ int builtin_load_env(struct grub2_script *script,
 
        rc = parser_request_file(script->ctx, dev, envpath, &buf, &len);
 
-       if (!rc)
+       if (!rc) {
                rc = parse_buf_to_env(script, buf, len);
-
-       talloc_free(buf);
+               talloc_free(buf);
+       }
 
        return 0;
 }