Stefan Hajnoczi e7f5993354 loader: extract rom_free() function
The next patch will need to free a rom.  There is already code to do
this in rom_add_file().

Note that rom_add_file() uses:

  rom = g_malloc0(sizeof(*rom));
  ...
  if (rom->fw_dir) {
      g_free(rom->fw_dir);
      g_free(rom->fw_file);
  }

The conditional is unnecessary since g_free(NULL) is a no-op.

Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Message-id: 20180814162739.11814-4-stefanha@redhat.com
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-08-16 14:05:28 +01:00
..
2018-07-24 17:02:02 +01:00
2018-07-17 17:06:32 +01:00
2018-08-16 14:05:28 +01:00
2018-07-02 19:07:19 +01:00
2018-07-20 08:30:48 +08:00
2016-01-29 15:07:25 +00:00
2018-07-30 17:41:52 +02:00
2018-07-02 19:07:19 +01:00
2018-07-02 19:07:19 +01:00
2018-06-01 15:14:31 +02:00