Skip to content

Commit

Permalink
loader: fix potential memory leak
Browse files Browse the repository at this point in the history
Signed-off-by: Cao jin <caoj.fnst@cn.fujitsu.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
Cao jin authored and Michael Tokarev committed May 18, 2016
1 parent ec60965 commit ed2f3bc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions hw/core/loader.c
Expand Up @@ -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;
}

Expand Down

0 comments on commit ed2f3bc

Please sign in to comment.