On 10/29/20 8:57 PM, Richard Henderson wrote:
> On 10/28/20 12:22 PM, Philippe Mathieu-Daudé wrote:
>> +g_autofree void *dtb;
>>
>> dtb = load_device_tree(dtb_filename, &dtb_size);
>
> With g_autofree, we must initialize the variable on declaration. Often this
> is
> w
On 10/28/20 12:22 PM, Philippe Mathieu-Daudé wrote:
> +g_autofree void *dtb;
>
> dtb = load_device_tree(dtb_filename, &dtb_size);
With g_autofree, we must initialize the variable on declaration. Often this is
with NULL, but in this case, just merge these two lines.
Wit
As load_device_tree() returns allocated memory,
we need to free it.
Cc: Yoshinori Sato
Fixes: bda19d7bb56 ("hw/rx: Add RX GDB simulator")
Reported-by: Coverity (CID 1432307: RESOURCE_LEAK)
Signed-off-by: Philippe Mathieu-Daudé
---
Peter mentioned this issue almost 2 months ago:
https://www.mail-