qemu-trivial
[Top][All Lists]
Advanced

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

Re: [Qemu-trivial] [PATCH v2 2/7] hw/mips/mips_jazz.c: Store irq array i


From: Michael Tokarev
Subject: Re: [Qemu-trivial] [PATCH v2 2/7] hw/mips/mips_jazz.c: Store irq array in MachineState to fix memory leak
Date: Thu, 04 Jun 2015 18:17:18 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0

04.06.2015 18:14, Michael Tokarev wrote:
> 04.06.2015 18:09, Shannon Zhao wrote:
>> On 2015/6/4 22:57, Michael Tokarev wrote:
>>> 04.06.2015 17:51, Shannon Zhao wrote:
>>>>> Yeah, but I think something like below would work.
>>>>>
>>>>>     cpu_exit_irq = &qemu_allocate_irq(cpu_request_exit, NULL, 0);
>>>>>     DMA_init(0, cpu_exit_irq);
>>> NO!!!:)
>>
>> Hmm...really?
> 
> Really-really :)
> 
> You're getting an address of a temporary local variable
> returned from qemu_allocate_irq,

If this is valid at all, to which I'm not sure.

Even for this:

 int foo();

 int *var = &foo();

/mjt\



reply via email to

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