Leo Sandoval
f26b39860d
commands/legacycfg: Avoid closing file twice
An internal (at Red Hat) static soure code scan detected an
use-after-free scenario:
Error: USE_AFTER_FREE (CWE-416):
grub-2.06/grub-core/commands/legacycfg.c:194: freed_arg: "grub_file_close" frees "file".
grub-2.06/grub-core/commands/legacycfg.c:201: deref_arg: Calling "grub_file_close" dereferences freed pointer "file".
# 199| if (!args)
# 200| {
# 201|-> grub_file_close (file);
# 202| grub_free (suffix);
# 203| grub_free (entrysrc);
So, remove the extra file close call.
Signed-off-by: Leo Sandoval <lsandova@redhat.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2024-10-31 16:08:36 +01:00
..
2019-04-08 15:22:10 +10:00
2022-04-20 18:27:52 +02:00
2024-10-31 16:08:36 +01:00
2024-06-20 15:51:52 +02:00
2023-11-08 05:04:24 +01:00
2023-05-16 18:51:12 +02:00
2024-09-05 17:08:38 +02:00
2023-01-19 17:39:04 +01:00
2022-03-14 15:45:59 +01:00
2024-04-11 15:48:25 +02:00
2012-03-03 13:05:08 +01:00
2011-11-11 21:03:49 +01:00
2024-06-06 16:55:15 +02:00
2024-10-31 16:07:03 +01:00
2024-10-10 13:10:10 +02:00
2024-10-10 13:11:23 +02:00
2023-05-25 16:48:00 +02:00
2024-10-10 12:38:47 +02:00
2024-10-10 12:36:56 +02:00
2024-06-20 19:14:41 +02:00
2023-11-08 05:05:06 +01:00
2022-11-14 17:17:21 +01:00
2022-03-14 15:59:45 +01:00
2024-10-10 12:36:56 +02:00
2022-03-14 16:00:27 +01:00
2023-08-31 17:21:40 +02:00
2023-03-14 16:07:54 +01:00
2023-03-14 16:07:54 +01:00
2014-01-18 23:15:40 +04:00
2014-01-18 23:15:40 +04:00
2024-10-10 13:18:00 +02:00
2024-05-09 15:04:54 +02:00
2017-05-03 12:49:31 +02:00
2022-03-21 18:47:16 +01:00
2013-03-01 11:15:09 +01:00
2024-05-09 15:04:54 +02:00
2024-09-05 17:25:27 +02:00
2017-05-03 12:49:31 +02:00