From 516dc589b7eac6b7e13aa96ef9b3c104f1c8c8f5 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Mon, 1 Jul 2024 21:00:26 -0400 Subject: [PATCH] Handle freeing mallocs in config.c properly --- src/config.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/config.c b/src/config.c index a98111edc..3035be95f 100644 --- a/src/config.c +++ b/src/config.c @@ -433,8 +433,11 @@ load_video(void) free_p = 1; } gfxcard[0] = video_get_video_from_internal_name(p); - if (free_p) + if (free_p) { free(p); + p = NULL; + free_p = 0; + } } if (((gfxcard[0] == VID_INTERNAL) && machine_has_flags(machine, MACHINE_VIDEO_8514A)) || @@ -853,6 +856,7 @@ load_storage_controllers(void) if (free_p) { free(p); p = NULL; + free_p = 0; } ide_ter_enabled = !!ini_section_get_int(cat, "ide_ter", 0);