grub-mkimage: postpone free(arguments.output)
PATCH 1/1 grub-mkimage: postpone free(arguments.output)
The output filename is currently free()d before the call to generate_image(), which takes this as a parameter.
This patch delays the free until after generate_image returns.
=== modified file 'util/grub-mkimage.c'
grub-mkimage.c +3 -1
@@ -1862,7 +1862,6 @@if (! fp)grub_util_error (_ ("cannot open `%s': %s" ), arguments.output,strerror (errno)); -free (arguments.output); }if (!arguments.dir)
@@ -1889,5 +1888,8 @@if (arguments.dir)free (arguments.dir); +if (arguments.output) +free (arguments.output); +return 0 ; }
Quoted 4 lines · Leif Lindholm
The output filename is currently free()d before the call to
generate_image(), which takes this as a parameter.This patch delays the free until after
generate_imagereturns.
Looks correct. Committed with an added ChangeLog entry; thanks.
Signature · 1 line
Colin Watson [[email protected]]