]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
util/grub-mkfont: Fix memory leak in write_font_pf2()
authorDarren Kenny <darren.kenny@oracle.com>
Tue, 26 Oct 2021 15:02:38 +0000 (15:02 +0000)
committerDaniel Kiper <daniel.kiper@oracle.com>
Tue, 2 Nov 2021 15:41:09 +0000 (16:41 +0100)
In the function write_font_pf2() memory is allocated for font_name to
construct a new name, but it is not released before returning from the
function, leaking the allocated memory.

Fixes: CID 314015
Signed-off-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
util/grub-mkfont.c

index 0fe45a6103ddfdadb71fbfde59edd29450ad9b06..fdfd70d654af16bb8f8291cf3dd3fc3594bd292a 100644 (file)
@@ -928,6 +928,7 @@ write_font_pf2 (struct grub_font_info *font_info, char *output_file)
                             file, output_file);
     }
 
+  free (font_name);
   fclose (file);
 }