]> git.ozlabs.org Git - petitboot/blobdiff - discover/grub2/env.c
discover/grub2: improve handling of word & delimiter tokens
[petitboot] / discover / grub2 / env.c
index 90e9c69667abe47db82ee324c3f52052bba99648..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 <array-size/array-size.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;
 }