[1/3] pci: Fix memory leak

Submitted by Stefan Weil on Jan. 22, 2011, 12:02 p.m.

Details

Message ID 1295697766-8851-1-git-send-email-weil@mail.berlios.de
State Accepted
Headers show

Commit Message

Stefan Weil Jan. 22, 2011, 12:02 p.m.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 hw/pci.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Aurelien Jarno Feb. 20, 2011, 5:24 p.m.
On Sat, Jan 22, 2011 at 01:02:44PM +0100, Stefan Weil wrote:
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> ---
>  hw/pci.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)

Thanks all three patches applied.

> diff --git a/hw/pci.c b/hw/pci.c
> index 63f476a..38a60ae 100644
> --- a/hw/pci.c
> +++ b/hw/pci.c
> @@ -1877,6 +1877,7 @@ static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom)
>      if (size < 0) {
>          error_report("%s: failed to find romfile \"%s\"",
>                       __FUNCTION__, pdev->romfile);
> +        qemu_free(path);
>          return -1;
>      }
>      if (size & (size - 1)) {
> -- 
> 1.7.2.3
> 
> 
>

Patch hide | download patch | download mbox

diff --git a/hw/pci.c b/hw/pci.c
index 63f476a..38a60ae 100644
--- a/hw/pci.c
+++ b/hw/pci.c
@@ -1877,6 +1877,7 @@  static int pci_add_option_rom(PCIDevice *pdev, bool is_default_rom)
     if (size < 0) {
         error_report("%s: failed to find romfile \"%s\"",
                      __FUNCTION__, pdev->romfile);
+        qemu_free(path);
         return -1;
     }
     if (size & (size - 1)) {