From 6be2cb1c0139ac177e754b0767abf1ca1533847f Mon Sep 17 00:00:00 2001 From: Robbie Harwood Date: Mon, 18 Apr 2022 13:08:18 -0400 Subject: [PATCH] Fix invalid free in main() data is allocated by mmap() in prepare_data(). Resolves: #173 Signed-off-by: Robbie Harwood --- src/efivar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/efivar.c b/src/efivar.c index 5cd1eb2b..09f85edd 100644 --- a/src/efivar.c +++ b/src/efivar.c @@ -633,7 +633,7 @@ int main(int argc, char *argv[]) if (sz < 0) err(1, "Could not import data from \"%s\"", infile); - free(data); + munmap(data, data_size); data = NULL; data_size = 0;