diff mbox series

bootloader: cboot: fix close call in error branch

Message ID 20240425165648.2804129-1-stefano.babic@swupdate.org
State Accepted
Headers show
Series bootloader: cboot: fix close call in error branch | expand

Commit Message

Stefano Babic April 25, 2024, 4:56 p.m. UTC
This module uses fopen(), and fclose() must be used to close the FILE.

Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
---
 bootloader/cboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.34.1
diff mbox series

Patch

diff --git a/bootloader/cboot.c b/bootloader/cboot.c
index db076395..bd4d9c08 100644
--- a/bootloader/cboot.c
+++ b/bootloader/cboot.c
@@ -138,7 +138,7 @@  static int do_apply_list(const char *filename)
 	int result = 0;
 	if (libcboot.open(BOOTINFO_O_RDWR, &ctx) < 0) {
 		ERROR("libcboot.open returns with error");
-		close(file);
+		fclose(file);
 		return -ENOENT;
 	}
 	while ((getline(&line, &length, file)) != -1) {