loader: fix potential memory leak

Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
This commit is contained in:
Cao jin 2016-02-24 17:12:47 +08:00 committed by Michael Tokarev
parent ec609656fc
commit ed2f3bc1fa

View File

@ -914,10 +914,16 @@ int rom_add_file(const char *file, const char *fw_dir,
err:
if (fd != -1)
close(fd);
g_free(rom->data);
g_free(rom->path);
g_free(rom->name);
if (fw_dir) {
g_free(rom->fw_dir);
g_free(rom->fw_file);
}
g_free(rom);
return -1;
}