diff mbox series

[3/6] grub: fix double-close on error

Message ID 20220530060304.1296389-4-dominique.martinet@atmark-techno.com
State Accepted
Headers show
Series Fix gcc warnings or -fanalyzer warnings | expand

Commit Message

Dominique Martinet May 30, 2022, 6:03 a.m. UTC
fp is closed in 'cleanup' label: do not close before goto

Reported-by: gcc -fanalyzer
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
---
 bootloader/grub.c | 1 -
 1 file changed, 1 deletion(-)
diff mbox series

Patch

diff --git a/bootloader/grub.c b/bootloader/grub.c
index 2d901b33293d..21bb6ac41a4d 100644
--- a/bootloader/grub.c
+++ b/bootloader/grub.c
@@ -52,7 +52,6 @@  static int grubenv_open(struct grubenv_t *grubenv)
 	buf = calloc(1, size + 1);
 	if (!buf) {
 		ERROR("Not enough memory for environment");
-		fclose(fp);
 		ret = -ENOMEM;
 		goto cleanup;
 	}