#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"
static int parse_buf_to_env(struct grub2_script *script, void *buf, int len)
{
- char *tmp, *line, *sep;
+ char *tmp = NULL, *line, *sep;
int siglen;
siglen = strlen(signature);
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;
}