qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] s390: Plug memory leak on s390_pci_generate_eve


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH] s390: Plug memory leak on s390_pci_generate_event() error path
Date: Tue, 20 Jan 2015 11:07:47 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0


On 20/01/2015 10:56, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
>  hw/s390x/s390-pci-bus.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c
> index 1201b8d..d25ac74 100644
> --- a/hw/s390x/s390-pci-bus.c
> +++ b/hw/s390x/s390-pci-bus.c
> @@ -187,7 +187,7 @@ S390PCIBusDevice *s390_pci_find_dev_by_fh(uint32_t fh)
>  static void s390_pci_generate_event(uint8_t cc, uint16_t pec, uint32_t fh,
>                                      uint32_t fid, uint64_t faddr, uint32_t e)
>  {
> -    SeiContainer *sei_cont = g_malloc0(sizeof(SeiContainer));
> +    SeiContainer *sei_cont;
>      S390pciState *s = S390_PCI_HOST_BRIDGE(
>          object_resolve_path(TYPE_S390_PCI_HOST_BRIDGE, NULL));
>  
> @@ -195,6 +195,7 @@ static void s390_pci_generate_event(uint8_t cc, uint16_t 
> pec, uint32_t fh,
>          return;
>      }
>  
> +    sei_cont = g_malloc0(sizeof(SeiContainer));
>      sei_cont->fh = fh;
>      sei_cont->fid = fid;
>      sei_cont->cc = cc;
> 

A patch for this had been sent already, though I prefer yours.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]