Re: [PATCH] vbox: Drop needless g_new0(..., 0) in vbox_snapshot_conf.c

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

 



On Fri, Apr 12, 2024 at 08:52:37PM +0200, Michal Privoznik wrote:
> clang on Fedora started to complain about some calls to g_new0()
> we're making in vbox_snapshot_conf.c. Specifically, we're passing
> zero as number of elements to allocate. And while usually SA
> tools are not clever, in this specific case clang is right.
> There are three cases where such call is made, but all of them
> later use VIR_EXPAND_N() to allocate more memory (if needed). But
> VIR_EXPAND_N() accepts a variable set to NULL happily.
> 
> Therefore, just drop those three calls to g_new0(..., 0) and let
> VIR_EXPAND_N() allocate memory.
> 
> Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
> ---
>  src/vbox/vbox_snapshot_conf.c | 6 ------
>  1 file changed, 6 deletions(-)

Reviewed-by: Pavel Hrdina <phrdina@xxxxxxxxxx>

Attachment: signature.asc
Description: PGP signature

_______________________________________________
Devel mailing list -- devel@xxxxxxxxxxxxxxxxx
To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxx

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux